summaryrefslogtreecommitdiffstats
path: root/services/repository
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-17 14:24:47 +0800
committerGitHub <noreply@github.com>2021-12-17 14:24:47 +0800
commita6d4a8546a772ede0f59317eb51b9a90370cb67b (patch)
tree0437221d185ba797ee01b0965d9e015f50d47e21 /services/repository
parentd29b689f813ee83a4ec3526fbad7fb76a6958cc0 (diff)
downloadgitea-a6d4a8546a772ede0f59317eb51b9a90370cb67b.tar.gz
gitea-a6d4a8546a772ede0f59317eb51b9a90370cb67b.zip
Fix rename notification bug (#18008)
Diffstat (limited to 'services/repository')
-rw-r--r--services/repository/transfer.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/repository/transfer.go b/services/repository/transfer.go
index 83cac401d6..1e8b78dfc6 100644
--- a/services/repository/transfer.go
+++ b/services/repository/transfer.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models/perm"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
+ "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/sync"
)
@@ -57,6 +58,8 @@ func TransferOwnership(doer, newOwner *user_model.User, repo *repo_model.Reposit
// ChangeRepositoryName changes all corresponding setting from old repository name to new one.
func ChangeRepositoryName(doer *user_model.User, repo *repo_model.Repository, newRepoName string) error {
+ log.Trace("ChangeRepositoryName: %s/%s -> %s", doer.Name, repo.Name, newRepoName)
+
oldRepoName := repo.Name
// Change repository directory name. We must lock the local copy of the
@@ -70,6 +73,7 @@ func ChangeRepositoryName(doer *user_model.User, repo *repo_model.Repository, ne
}
repoWorkingPool.CheckOut(fmt.Sprint(repo.ID))
+ repo.Name = newRepoName
notification.NotifyRenameRepository(doer, repo, oldRepoName)
return nil