diff options
Diffstat (limited to 'routers/api/v1/repo.go')
-rw-r--r-- | routers/api/v1/repo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index d683eac3f9..fdf05c0529 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -104,7 +104,7 @@ func createRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoO repo, err := models.CreateRepository(owner, opt.Name, opt.Description, opt.Gitignore, opt.License, opt.Private, false, opt.AutoInit) if err != nil { - if err == models.ErrRepoAlreadyExist || + if models.IsErrRepoAlreadyExist(err) || models.IsErrNameReserved(err) || models.IsErrNamePatternNotAllowed(err) { ctx.JSON(422, &base.ApiJsonErr{err.Error(), base.DOC_URL}) |