aboutsummaryrefslogtreecommitdiffstats
path: root/services/task
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-12 23:48:20 +0800
committerGitHub <noreply@github.com>2021-12-12 23:48:20 +0800
commit572324049008ac803d3d7c17a7b3a81ef00386fc (patch)
treea9c3709643a23165d27aa67e76f10f26a89936d5 /services/task
parent0a7e8327a017c5dd43e552bbcd0d0f056bc1671b (diff)
downloadgitea-572324049008ac803d3d7c17a7b3a81ef00386fc.tar.gz
gitea-572324049008ac803d3d7c17a7b3a81ef00386fc.zip
Some repository refactors (#17950)
* some repository refactors * remove unnecessary code * Fix test * Remove unnecessary banner
Diffstat (limited to 'services/task')
-rw-r--r--services/task/migrate.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/task/migrate.go b/services/task/migrate.go
index dbe237b691..d6ff514320 100644
--- a/services/task/migrate.go
+++ b/services/task/migrate.go
@@ -27,9 +27,9 @@ import (
func handleCreateError(owner *user_model.User, err error) error {
switch {
- case models.IsErrReachLimitOfRepo(err):
+ case repo_model.IsErrReachLimitOfRepo(err):
return fmt.Errorf("You have already reached your limit of %d repositories", owner.MaxCreationLimit())
- case models.IsErrRepoAlreadyExist(err):
+ case repo_model.IsErrRepoAlreadyExist(err):
return errors.New("The repository name is already used")
case db.IsErrNameReserved(err):
return fmt.Errorf("The repository name '%s' is reserved", err.(db.ErrNameReserved).Name)
@@ -123,7 +123,7 @@ func runMigrateTask(t *models.Task) (err error) {
return
}
- if models.IsErrRepoAlreadyExist(err) {
+ if repo_model.IsErrRepoAlreadyExist(err) {
err = errors.New("The repository name is already used")
return
}