From ad2bf376dfd934394cad46c3ff3e022ca232958f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 6 Sep 2020 22:58:54 +0200 Subject: [PATCH] RepoInit Respect AlternateDefaultBranch (#12746) --- modules/repository/create.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/repository/create.go b/modules/repository/create.go index 945f4a8cea..abbec05a37 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -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,