summaryrefslogtreecommitdiffstats
path: root/services/repository/transfer.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-24 17:49:20 +0800
committerGitHub <noreply@github.com>2021-11-24 17:49:20 +0800
commita666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch)
tree9ab1434b759a8a2cb275a83149903a823851e309 /services/repository/transfer.go
parent4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff)
downloadgitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz
gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip
Move user related model into models/user (#17781)
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
Diffstat (limited to 'services/repository/transfer.go')
-rw-r--r--services/repository/transfer.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/repository/transfer.go b/services/repository/transfer.go
index bb323c1c0a..e6b73fc9e0 100644
--- a/services/repository/transfer.go
+++ b/services/repository/transfer.go
@@ -8,6 +8,7 @@ import (
"fmt"
"code.gitea.io/gitea/models"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/sync"
)
@@ -16,7 +17,7 @@ import (
var repoWorkingPool = sync.NewExclusivePool()
// TransferOwnership transfers all corresponding setting from old user to new one.
-func TransferOwnership(doer, newOwner *models.User, repo *models.Repository, teams []*models.Team) error {
+func TransferOwnership(doer, newOwner *user_model.User, repo *models.Repository, teams []*models.Team) error {
if err := repo.GetOwner(); err != nil {
return err
}
@@ -52,7 +53,7 @@ func TransferOwnership(doer, newOwner *models.User, repo *models.Repository, tea
}
// ChangeRepositoryName changes all corresponding setting from old repository name to new one.
-func ChangeRepositoryName(doer *models.User, repo *models.Repository, newRepoName string) error {
+func ChangeRepositoryName(doer *user_model.User, repo *models.Repository, newRepoName string) error {
oldRepoName := repo.Name
// Change repository directory name. We must lock the local copy of the
@@ -73,7 +74,7 @@ func ChangeRepositoryName(doer *models.User, repo *models.Repository, newRepoNam
// StartRepositoryTransfer transfer a repo from one owner to a new one.
// it make repository into pending transfer state, if doer can not create repo for new owner.
-func StartRepositoryTransfer(doer, newOwner *models.User, repo *models.Repository, teams []*models.Team) error {
+func StartRepositoryTransfer(doer, newOwner *user_model.User, repo *models.Repository, teams []*models.Team) error {
if err := models.TestRepositoryReadyForTransfer(repo.Status); err != nil {
return err
}