From e0c18502dc1f88e1d4b35a7202c4fefcf5dc15ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 13 Aug 2020 17:18:48 +0200 Subject: [PATCH] Set receive.advertisePushOptions=true for new repos Required to be able to actually use them when pushing --- gitsrht-shell/main.go | 1 + gitsrht/repos.py | 1 + 2 files changed, 2 insertions(+) diff --git a/gitsrht-shell/main.go b/gitsrht-shell/main.go index 810a5d3..b203419 100644 --- a/gitsrht-shell/main.go +++ b/gitsrht-shell/main.go @@ -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) } diff --git a/gitsrht/repos.py b/gitsrht/repos.py index 03fd7f4..8691969 100644 --- a/gitsrht/repos.py +++ b/gitsrht/repos.py @@ -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")) -- 2.38.4