summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/migrate.go
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 /routers/api/v1/repo/migrate.go
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 'routers/api/v1/repo/migrate.go')
-rw-r--r--routers/api/v1/repo/migrate.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go
index 108d78ef23..8a6f421c87 100644
--- a/routers/api/v1/repo/migrate.go
+++ b/routers/api/v1/repo/migrate.go
@@ -214,15 +214,15 @@ func Migrate(ctx *context.APIContext) {
func handleMigrateError(ctx *context.APIContext, repoOwner *user_model.User, remoteAddr string, err error) {
switch {
- case models.IsErrRepoAlreadyExist(err):
+ case repo_model.IsErrRepoAlreadyExist(err):
ctx.Error(http.StatusConflict, "", "The repository with the same name already exists.")
- case models.IsErrRepoFilesAlreadyExist(err):
+ case repo_model.IsErrRepoFilesAlreadyExist(err):
ctx.Error(http.StatusConflict, "", "Files already exist for this repository. Adopt them or delete them.")
case migrations.IsRateLimitError(err):
ctx.Error(http.StatusUnprocessableEntity, "", "Remote visit addressed rate limitation.")
case migrations.IsTwoFactorAuthError(err):
ctx.Error(http.StatusUnprocessableEntity, "", "Remote visit required two factors authentication.")
- case models.IsErrReachLimitOfRepo(err):
+ case repo_model.IsErrReachLimitOfRepo(err):
ctx.Error(http.StatusUnprocessableEntity, "", fmt.Sprintf("You have already reached your limit of %d repositories.", repoOwner.MaxCreationLimit()))
case db.IsErrNameReserved(err):
ctx.Error(http.StatusUnprocessableEntity, "", fmt.Sprintf("The username '%s' is reserved.", err.(db.ErrNameReserved).Name))