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>
This commit is contained in:
parent
9e6a79bea9
commit
6bf78d2b57
7 changed files with 11 additions and 3 deletions
|
@ -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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue