summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2019-02-21 16:07:58 -0600
committertechknowlogick <matti@mdranta.net>2019-02-21 17:07:58 -0500
commitdf30010dbdd2c9479aee292f5759b85143558498 (patch)
tree3a4232b2292d9989c41885d28b1227f12e994398 /routers/api/v1
parent3b61ff1895d07ef66c8d9cb2408cba1c2490996a (diff)
downloadgitea-df30010dbdd2c9479aee292f5759b85143558498.tar.gz
gitea-df30010dbdd2c9479aee292f5759b85143558498.zip
Make repo creation for API similar to UI (#6142)
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/repo/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index f69cbee0c0..4156775286 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -213,6 +213,9 @@ func Search(ctx *context.APIContext) {
// CreateUserRepo create a repository for a user
func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateRepoOption) {
+ if opt.AutoInit && opt.Readme == "" {
+ opt.Readme = "Default"
+ }
repo, err := models.CreateRepository(ctx.User, owner, models.CreateRepoOptions{
Name: opt.Name,
Description: opt.Description,