Skip to content

Commit df30010

Browse files
jolheisertechknowlogick
authored andcommitted
Make repo creation for API similar to UI (#6142)
1 parent 3b61ff1 commit df30010

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

routers/api/v1/repo/repo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ func Search(ctx *context.APIContext) {
213213

214214
// CreateUserRepo create a repository for a user
215215
func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateRepoOption) {
216+
if opt.AutoInit && opt.Readme == "" {
217+
opt.Readme = "Default"
218+
}
216219
repo, err := models.CreateRepository(ctx.User, owner, models.CreateRepoOptions{
217220
Name: opt.Name,
218221
Description: opt.Description,

0 commit comments

Comments
 (0)