aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-05-08 21:17:11 +0800
committerGitHub <noreply@github.com>2024-05-08 13:17:11 +0000
commitf5f921c09555f5b31226fc31bbbb463649d0bfdc (patch)
tree2dc2d521f47dc794d7f86862f0b651aa1fbf7d3a /routers/web/repo
parentd9b37d085acb7e93409061e541b6a3aa53261bb0 (diff)
downloadgitea-f5f921c09555f5b31226fc31bbbb463649d0bfdc.tar.gz
gitea-f5f921c09555f5b31226fc31bbbb463649d0bfdc.zip
Fix wrong transfer hint (#30889)
Fix #30187
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/setting/setting.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go
index 17a400e360..1e0349cdee 100644
--- a/routers/web/repo/setting/setting.go
+++ b/routers/web/repo/setting/setting.go
@@ -789,6 +789,7 @@ func SettingsPost(ctx *context.Context) {
ctx.Repo.GitRepo = nil
}
+ oldFullname := repo.FullName()
if err := repo_service.StartRepositoryTransfer(ctx, ctx.Doer, newOwner, repo, nil); err != nil {
if repo_model.IsErrRepoAlreadyExist(err) {
ctx.RenderWithErr(ctx.Tr("repo.settings.new_owner_has_same_repo"), tplSettingsOptions, nil)
@@ -803,8 +804,13 @@ func SettingsPost(ctx *context.Context) {
return
}
- log.Trace("Repository transfer process was started: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner)
- ctx.Flash.Success(ctx.Tr("repo.settings.transfer_started", newOwner.DisplayName()))
+ if ctx.Repo.Repository.Status == repo_model.RepositoryPendingTransfer {
+ log.Trace("Repository transfer process was started: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner)
+ ctx.Flash.Success(ctx.Tr("repo.settings.transfer_started", newOwner.DisplayName()))
+ } else {
+ log.Trace("Repository transferred: %s -> %s", oldFullname, ctx.Repo.Repository.FullName())
+ ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed"))
+ }
ctx.Redirect(repo.Link() + "/settings")
case "cancel_transfer":