diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-12-10 09:27:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 09:27:50 +0800 |
commit | 719bddcd76610a63dadc8555760072957a11cf30 (patch) | |
tree | 0df26092fba7e3e21444fe493e6b349473b6b0cb /services/migrations/gitea_uploader.go | |
parent | fb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff) | |
download | gitea-719bddcd76610a63dadc8555760072957a11cf30.tar.gz gitea-719bddcd76610a63dadc8555760072957a11cf30.zip |
Move repository model into models/repo (#17933)
* Some refactors related repository model
* Move more methods out of repository
* Move repository into models/repo
* Fix test
* Fix test
* some improvements
* Remove unnecessary function
Diffstat (limited to 'services/migrations/gitea_uploader.go')
-rw-r--r-- | services/migrations/gitea_uploader.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go index 4808916c1d..0887aa1132 100644 --- a/services/migrations/gitea_uploader.go +++ b/services/migrations/gitea_uploader.go @@ -43,7 +43,7 @@ type GiteaLocalUploader struct { doer *user_model.User repoOwner string repoName string - repo *models.Repository + repo *repo_model.Repository labels sync.Map milestones sync.Map issues sync.Map @@ -93,7 +93,7 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate return err } - var r *models.Repository + var r *repo_model.Repository if opts.MigrateToRepoID <= 0 { r, err = repo_module.CreateRepository(g.doer, owner, models.CreateRepoOptions{ Name: g.repoName, @@ -102,10 +102,10 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate GitServiceType: opts.GitServiceType, IsPrivate: opts.Private, IsMirror: opts.Mirror, - Status: models.RepositoryBeingMigrated, + Status: repo_model.RepositoryBeingMigrated, }) } else { - r, err = models.GetRepositoryByID(opts.MigrateToRepoID) + r, err = repo_model.GetRepositoryByID(opts.MigrateToRepoID) } if err != nil { return err @@ -979,6 +979,6 @@ func (g *GiteaLocalUploader) Finish() error { return err } - g.repo.Status = models.RepositoryReady + g.repo.Status = repo_model.RepositoryReady return models.UpdateRepositoryCols(g.repo, "status") } |