summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-12 20:11:17 +0800
committerGitHub <noreply@github.com>2020-01-12 20:11:17 +0800
commitb465d0d78793da6e67890a7cb9d3ae1b807c53ca (patch)
tree1cdfb83699ad2fd31d5835bb2ac1e1b579eaf784 /routers/api
parent5765212c6dbcaeb27779707af3ca57775e535bd9 (diff)
downloadgitea-b465d0d78793da6e67890a7cb9d3ae1b807c53ca.tar.gz
gitea-b465d0d78793da6e67890a7cb9d3ae1b807c53ca.zip
Move create/fork repository from models to modules/repository (#9489)
* Move create/fork repository from models to modules/repository * fix wrong reference * fix test * fix test * fix lint * Fix DBContext * remove duplicated TestMain * fix lint * fix conflicts
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/repo.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 2990ccd276..c7959c6db9 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -22,8 +22,8 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/migrations"
"code.gitea.io/gitea/modules/notification"
+ repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
- "code.gitea.io/gitea/modules/structs"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/validation"
@@ -451,10 +451,10 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
return
}
- var gitServiceType = structs.PlainGitService
+ var gitServiceType = api.PlainGitService
u, err := url.Parse(remoteAddr)
if err == nil && strings.EqualFold(u.Host, "github.com") {
- gitServiceType = structs.GithubService
+ gitServiceType = api.GithubService
}
var opts = migrations.MigrateOptions{
@@ -483,7 +483,7 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
opts.Releases = false
}
- repo, err := models.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
+ repo, err := repo_module.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
Name: opts.RepoName,
Description: opts.Description,
OriginalURL: form.CloneAddr,