diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-10 17:34:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 17:34:21 +0800 |
commit | 99d869fa63e07780f1a17d1a9599187b9b689d9b (patch) | |
tree | ecadeba077cf0ae58d0a21f232d280fec60c779a /services | |
parent | 384c2b342ec01fadb520572666127cb5564e1050 (diff) | |
download | gitea-99d869fa63e07780f1a17d1a9599187b9b689d9b.tar.gz gitea-99d869fa63e07780f1a17d1a9599187b9b689d9b.zip |
Move push commits from models to modules/repository (#9370)
* Move push commits from models to modules/repository
* fix test
* fix test
* fix test
* fix test
* fix test
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'services')
-rw-r--r-- | services/mirror/mirror.go | 2 | ||||
-rw-r--r-- | services/release/release.go | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go index 28b2e2a127..d4f97c2600 100644 --- a/services/mirror/mirror.go +++ b/services/mirror/mirror.go @@ -403,7 +403,7 @@ func syncMirror(repoID string) { continue } - theCommits := models.ListToPushCommits(commits) + theCommits := repository.ListToPushCommits(commits) if len(theCommits.Commits) > setting.UI.FeedMaxCommitNum { theCommits.Commits = theCommits.Commits[:setting.UI.FeedMaxCommitNum] } diff --git a/services/release/release.go b/services/release/release.go index fd0c410e7c..0f19db9ee2 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -13,6 +13,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/timeutil" ) @@ -43,7 +44,7 @@ func createTag(gitRepo *git.Repository, rel *models.Release) error { } notification.NotifyPushCommits( rel.Publisher, rel.Repo, git.TagPrefix+rel.TagName, - git.EmptySHA, commit.ID.String(), models.NewPushCommits()) + git.EmptySHA, commit.ID.String(), repository.NewPushCommits()) notification.NotifyCreateRef(rel.Publisher, rel.Repo, "tag", git.TagPrefix+rel.TagName) } commit, err := gitRepo.GetTagCommit(rel.TagName) |