diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-14 11:38:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-14 11:38:04 +0800 |
commit | 2677d071f911fb91f382acfedaedc251bd807f70 (patch) | |
tree | 61d48125ff6e509e5ffe385b23fdc14fb454b9e6 /services | |
parent | bca367cecc6004957a952bb6222b9bbdc868e784 (diff) | |
download | gitea-2677d071f911fb91f382acfedaedc251bd807f70.tar.gz gitea-2677d071f911fb91f382acfedaedc251bd807f70.zip |
Move newbranch to standalone package (#9627)
* Move newbranch to standalone package
* move branch functions to modules to avoid dependencies cycles
* fix tests
* fix lint
* fix lint
Diffstat (limited to 'services')
-rw-r--r-- | services/mirror/mirror.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go index 0c7f3ae3c7..e870364918 100644 --- a/services/mirror/mirror.go +++ b/services/mirror/mirror.go @@ -11,14 +11,13 @@ import ( "strings" "time" - "code.gitea.io/gitea/modules/graceful" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/cache" "code.gitea.io/gitea/modules/git" + "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" - "code.gitea.io/gitea/modules/repository" + repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/sync" "code.gitea.io/gitea/modules/timeutil" @@ -211,7 +210,7 @@ func runSync(m *models.Mirror) ([]*mirrorSyncResult, bool) { log.Error("OpenRepository: %v", err) return nil, false } - if err = repository.SyncReleasesWithTags(m.Repo, gitRepo); err != nil { + if err = repo_module.SyncReleasesWithTags(m.Repo, gitRepo); err != nil { gitRepo.Close() log.Error("Failed to synchronize tags to releases for repository: %v", err) } @@ -253,7 +252,7 @@ func runSync(m *models.Mirror) ([]*mirrorSyncResult, bool) { } } - branches, err := m.Repo.GetBranches() + branches, err := repo_module.GetBranches(m.Repo) if err != nil { log.Error("GetBranches: %v", err) return nil, false @@ -403,7 +402,7 @@ func syncMirror(repoID string) { continue } - theCommits := repository.ListToPushCommits(commits) + theCommits := repo_module.ListToPushCommits(commits) if len(theCommits.Commits) > setting.UI.FeedMaxCommitNum { theCommits.Commits = theCommits.Commits[:setting.UI.FeedMaxCommitNum] } |