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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

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{
OwnerID: u.ID,
Owner: u,