diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-15 01:30:01 +0800 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-12-14 18:30:01 +0100 |
commit | 7b2ff82d209c01be8082eaa9b888f93a00850d4d (patch) | |
tree | e3876a3f5c4b204b97bb0b611493c27453204a2c /services | |
parent | 2904abdc22da36a7110d0b69af0fd45cdb74ebf6 (diff) | |
download | gitea-7b2ff82d209c01be8082eaa9b888f93a00850d4d.tar.gz gitea-7b2ff82d209c01be8082eaa9b888f93a00850d4d.zip |
Move some repository methods from models to modules/repository (#9353)
* Move some repository methods from models to modules/repository
* fix test
Diffstat (limited to 'services')
-rw-r--r-- | services/mirror/mirror.go | 3 | ||||
-rw-r--r-- | services/mirror/mirror_test.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go index 9c52f1723b..1ad9448b6b 100644 --- a/services/mirror/mirror.go +++ b/services/mirror/mirror.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" + "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/sync" "code.gitea.io/gitea/modules/timeutil" @@ -207,7 +208,7 @@ func runSync(m *models.Mirror) ([]*mirrorSyncResult, bool) { log.Error("OpenRepository: %v", err) return nil, false } - if err = models.SyncReleasesWithTags(m.Repo, gitRepo); err != nil { + if err = repository.SyncReleasesWithTags(m.Repo, gitRepo); err != nil { gitRepo.Close() log.Error("Failed to synchronize tags to releases for repository: %v", err) } diff --git a/services/mirror/mirror_test.go b/services/mirror/mirror_test.go index 81811ffe4a..816ef230fd 100644 --- a/services/mirror/mirror_test.go +++ b/services/mirror/mirror_test.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" + "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/structs" release_service "code.gitea.io/gitea/services/release" @@ -46,7 +47,7 @@ func TestRelease_MirrorDelete(t *testing.T) { }) assert.NoError(t, err) - mirror, err := models.MigrateRepositoryGitData(user, user, mirrorRepo, opts) + mirror, err := repository.MigrateRepositoryGitData(user, user, mirrorRepo, opts) assert.NoError(t, err) gitRepo, err := git.OpenRepository(repoPath) |