Browse Source

Make repo creation for API similar to UI (#6142)

for-closed-social
John Olheiser 5 years ago
committed by techknowlogick
parent
commit
df30010dbd
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      routers/api/v1/repo/repo.go

+ 3
- 0
routers/api/v1/repo/repo.go View File

@ -213,6 +213,9 @@ func Search(ctx *context.APIContext) {
// CreateUserRepo create a repository for a user // CreateUserRepo create a repository for a user
func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateRepoOption) { 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{ repo, err := models.CreateRepository(ctx.User, owner, models.CreateRepoOptions{
Name: opt.Name, Name: opt.Name,
Description: opt.Description, Description: opt.Description,

Loading…
Cancel
Save