summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,