0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 11:42:49 +01:00

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

This commit is contained in:
John Olheiser 2019-02-21 16:07:58 -06:00 committed by techknowlogick
parent 3b61ff1895
commit df30010dbd

View file

@ -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,