diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-12 20:11:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-12 20:11:17 +0800 |
commit | b465d0d78793da6e67890a7cb9d3ae1b807c53ca (patch) | |
tree | 1cdfb83699ad2fd31d5835bb2ac1e1b579eaf784 /services/repository/repository.go | |
parent | 5765212c6dbcaeb27779707af3ca57775e535bd9 (diff) | |
download | gitea-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 'services/repository/repository.go')
-rw-r--r-- | services/repository/repository.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/repository/repository.go b/services/repository/repository.go index 2fb45bb617..eea8b352b4 100644 --- a/services/repository/repository.go +++ b/services/repository/repository.go @@ -10,11 +10,12 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" + repo_module "code.gitea.io/gitea/modules/repository" ) // CreateRepository creates a repository for the user/organization. func CreateRepository(doer, owner *models.User, opts models.CreateRepoOptions) (*models.Repository, error) { - repo, err := models.CreateRepository(doer, owner, opts) + repo, err := repo_module.CreateRepository(doer, owner, opts) if err != nil { if repo != nil { if errDelete := models.DeleteRepository(doer, owner.ID, repo.ID); errDelete != nil { @@ -31,7 +32,7 @@ func CreateRepository(doer, owner *models.User, opts models.CreateRepoOptions) ( // ForkRepository forks a repository func ForkRepository(doer, u *models.User, oldRepo *models.Repository, name, desc string) (*models.Repository, error) { - repo, err := models.ForkRepository(doer, u, oldRepo, name, desc) + repo, err := repo_module.ForkRepository(doer, u, oldRepo, name, desc) if err != nil { if repo != nil { if errDelete := models.DeleteRepository(doer, u.ID, repo.ID); errDelete != nil { |