summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-08-23 11:02:35 -0500
committerGitHub <noreply@github.com>2020-08-23 17:02:35 +0100
commit43a397ce9ae082e0c6e9367e31743e1cb4d71c20 (patch)
tree191f7510be4041eaa684bba99480ec0e4bc0bf87 /modules/git
parente7d65cbc6e50d70753f7228c46cbff0cffde7eba (diff)
downloadgitea-43a397ce9ae082e0c6e9367e31743e1cb4d71c20.tar.gz
gitea-43a397ce9ae082e0c6e9367e31743e1cb4d71c20.zip
Initial support for push options (#12169)
* Initial support for push options Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix misspelling 🤦 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix formatting after conflict resolution * defer close git repo * According the GitLab documentation, git >= 2.10 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Words are hard. Thanks @mrsdizzie :sweat_smile: Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Only update if there are push options Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/git.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/git/git.go b/modules/git/git.go
index 6f231cee7a..1061bdb0d5 100644
--- a/modules/git/git.go
+++ b/modules/git/git.go
@@ -120,6 +120,12 @@ func Init(ctx context.Context) error {
return err
}
+ if version.Compare(gitVersion, "2.10", ">=") {
+ if err := checkAndSetConfig("receive.advertisePushOptions", "true", true); err != nil {
+ return err
+ }
+ }
+
if version.Compare(gitVersion, "2.18", ">=") {
if err := checkAndSetConfig("core.commitGraph", "true", true); err != nil {
return err