1
0
Fork 0

RepoInit Respect AlternateDefaultBranch (#12746)

This commit is contained in:
6543 2020-09-06 22:58:54 +02:00 committed by GitHub
parent 0b198eb392
commit ad2bf376df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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,