Skip to content

Commit ad2bf37

Browse files
authored
RepoInit Respect AlternateDefaultBranch (#12746)
1 parent 0b198eb commit ad2bf37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/repository/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m
2323
}
2424
}
2525

26+
if len(opts.DefaultBranch) == 0 {
27+
opts.DefaultBranch = setting.Repository.DefaultBranch
28+
}
29+
2630
repo := &models.Repository{
2731
OwnerID: u.ID,
2832
Owner: u,

0 commit comments

Comments
 (0)