~edwargix/git.sr.ht

e0c18502dc1f88e1d4b35a7202c4fefcf5dc15ec — наб 4 years ago 5790471
Set receive.advertisePushOptions=true for new repos

Required to be able to actually use them when pushing
2 files changed, 2 insertions(+), 0 deletions(-)

M gitsrht-shell/main.go
M gitsrht/repos.py
M gitsrht-shell/main.go => gitsrht-shell/main.go +1 -0
@@ 313,6 313,7 @@ func main() {
				config.Raw.SetOption("core", "", "filemode", "true")
				config.Raw.SetOption("srht", "", "repo-id", strconv.Itoa(repoId))
				config.Raw.SetOption("receive", "", "denyDeleteCurrent", "ignore")
				config.Raw.SetOption("receive", "", "advertisePushOptions", "true")
				if err = repo.Storer.SetConfig(config); err != nil {
					notFound("git config save", err)
				}

M gitsrht/repos.py => gitsrht/repos.py +1 -0
@@ 96,6 96,7 @@ class GitRepoApi(SimpleRepoApi):
        # We handle this ourselves in the post-update hook, and git's
        # default behaviour is to print a large notice and reject the push entirely
        git_repo.config["receive.denyDeleteCurrent"] = "ignore"
        git_repo.config["receive.advertisePushOptions"] = True
        os.unlink(os.path.join(repo.path, "info", "exclude"))
        os.unlink(os.path.join(repo.path, "hooks", "README.sample"))
        os.unlink(os.path.join(repo.path, "description"))