aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repository
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-06 22:58:54 +0200
committerGitHub <noreply@github.com>2020-09-06 16:58:54 -0400
commitad2bf376dfd934394cad46c3ff3e022ca232958f (patch)
tree45880ebfd3dc60133cbf9a41234350a5b4a4823a /modules/repository
parent0b198eb392065a6b7b6c5e1744aa0fe1d9193f57 (diff)
downloadgitea-ad2bf376dfd934394cad46c3ff3e022ca232958f.tar.gz
gitea-ad2bf376dfd934394cad46c3ff3e022ca232958f.zip
RepoInit Respect AlternateDefaultBranch (#12746)
Diffstat (limited to 'modules/repository')
-rw-r--r--modules/repository/create.go4
1 files changed, 4 insertions, 0 deletions
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,