1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-07 19:17:21 +00:00

RepoInit Respect AlternateDefaultBranch (#12746) (#12751)

This commit is contained in:
6543
2020-09-07 00:03:50 +02:00
committed by GitHub
parent 0bb56a413d
commit dc71d00393

View File

@ -23,6 +23,10 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m
} }
} }
if len(opts.DefaultBranch) == 0 {
opts.DefaultBranch = setting.Repository.DefaultBranch
}
repo := &models.Repository{ repo := &models.Repository{
OwnerID: u.ID, OwnerID: u.ID,
Owner: u, Owner: u,