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>
This commit is contained in:
Lunny Xiao 2020-01-10 17:34:21 +08:00 committed by GitHub
parent 384c2b342e
commit 99d869fa63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 482 additions and 436 deletions

View file

@ -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]
}

View file

@ -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)