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 /modules/repofiles/action.go | |
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 'modules/repofiles/action.go')
-rw-r--r-- | modules/repofiles/action.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go index d207247114..07bc1b875b 100644 --- a/modules/repofiles/action.go +++ b/modules/repofiles/action.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" "code.gitea.io/gitea/modules/references" + "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" ) @@ -59,7 +60,7 @@ func changeIssueStatus(repo *models.Repository, issue *models.Issue, doer *model } // UpdateIssuesCommit checks if issues are manipulated by commit message. -func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*models.PushCommit, branchName string) error { +func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*repository.PushCommit, branchName string) error { // Commits are appended in the reverse order. for i := len(commits) - 1; i >= 0; i-- { c := commits[i] @@ -154,7 +155,7 @@ type CommitRepoActionOptions struct { RefFullName string OldCommitID string NewCommitID string - Commits *models.PushCommits + Commits *repository.PushCommits } // CommitRepoAction adds new commit action to the repository, and prepare @@ -216,10 +217,10 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error { if opts.NewCommitID == git.EmptySHA { opType = models.ActionDeleteTag } - opts.Commits = &models.PushCommits{} + opts.Commits = &repository.PushCommits{} } else if opts.NewCommitID == git.EmptySHA { opType = models.ActionDeleteBranch - opts.Commits = &models.PushCommits{} + opts.Commits = &repository.PushCommits{} } else { // if not the first commit, set the compare URL. if opts.OldCommitID == git.EmptySHA { |