summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-08 17:10:34 +0800
committerUnknwon <u@gogs.io>2015-08-08 17:10:34 +0800
commit9db4acc62e2d253c21ce9aed2e21003ff235d5b5 (patch)
tree1718b390dce8fb2e0771f4033cb1f6b24d66f0b3 /routers/api/v1/repo.go
parente6862e9cec49acf1cf8bbb5d1baee299a52b4967 (diff)
downloadgitea-9db4acc62e2d253c21ce9aed2e21003ff235d5b5.tar.gz
gitea-9db4acc62e2d253c21ce9aed2e21003ff235d5b5.zip
improve fork process
Diffstat (limited to 'routers/api/v1/repo.go')
-rw-r--r--routers/api/v1/repo.go2
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})