From dc71d00393e2090baa1035158d2e17c92b2b4564 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 7 Sep 2020 00:03:50 +0200 Subject: [PATCH] RepoInit Respect AlternateDefaultBranch (#12746) (#12751) --- modules/repository/create.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/repository/create.go b/modules/repository/create.go index 2f7d10f0d..0aafb7c21 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,