Skip to content

Commit dc71d00

Browse files
authored
RepoInit Respect AlternateDefaultBranch (#12746) (#12751)
1 parent 0bb56a4 commit dc71d00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/repository/create.go

+4
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)