summaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-09-12 18:29:58 -0400
committerUnknwon <joe2010xtmf@163.com>2014-09-12 18:29:58 -0400
commitcfed11f092580ecf47cff43274c7cdd10d07bffd (patch)
tree0fc15282e980d9e65341a3ad009f982db0a10b5a /routers/repo/setting.go
parentf67c59135fe258a9e839af7f839770b445d58732 (diff)
downloadgitea-cfed11f092580ecf47cff43274c7cdd10d07bffd.tar.gz
gitea-cfed11f092580ecf47cff43274c7cdd10d07bffd.zip
Bug: Transfer repository doesn't update the count
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r--routers/repo/setting.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 80a064492e..2354fbc13f 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -113,7 +113,11 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_owner_name"), SETTINGS_OPTIONS, nil)
return
} else if err = models.TransferOwnership(ctx.Repo.Owner, newOwner, ctx.Repo.Repository); err != nil {
- ctx.Handle(500, "TransferOwnership", err)
+ if err == models.ErrRepoAlreadyExist {
+ ctx.RenderWithErr(ctx.Tr("repo.settings.new_owner_has_same_repo"), SETTINGS_OPTIONS, nil)
+ } else {
+ ctx.Handle(500, "TransferOwnership", err)
+ }
return
}
log.Trace("Repository transfered: %s/%s -> %s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newOwner)