diff options
author | techknowlogick <techknowlogick@gitea.io> | 2020-06-17 16:53:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 16:53:55 -0400 |
commit | 6bf78d2b576a5caa77a670db9bbf2572d0272f25 (patch) | |
tree | 36b547e948ac0c1aed41c5088f397ea50fa905ee /modules/repository/init.go | |
parent | 9e6a79bea9d7911c81b86a6d3715d340fc19032a (diff) | |
download | gitea-6bf78d2b576a5caa77a670db9bbf2572d0272f25.tar.gz gitea-6bf78d2b576a5caa77a670db9bbf2572d0272f25.zip |
Global default branch setting (#11918)
* Global default branch setting
* add to app.ini example per @silverwind
* update per @lunny
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Diffstat (limited to 'modules/repository/init.go')
-rw-r--r-- | modules/repository/init.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/repository/init.go b/modules/repository/init.go index f468ca0435..8f3f2f0590 100644 --- a/modules/repository/init.go +++ b/modules/repository/init.go @@ -16,6 +16,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/setting" "github.com/mcuadros/go-version" "github.com/unknwon/com" @@ -147,7 +148,7 @@ func initRepoCommit(tmpPath string, repo *models.Repository, u *models.User, def } if len(defaultBranch) == 0 { - defaultBranch = "master" + defaultBranch = setting.Repository.DefaultBranch } if stdout, err := git.NewCommand("push", "origin", "master:"+defaultBranch). |