diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-10-31 05:59:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 22:59:02 +0100 |
commit | 4df2ed29f28194513c59733e369152b8f8bc1d36 (patch) | |
tree | 3bb0604e902390f37e2c9a8104f4ccaf495b4291 /modules/notification/indexer/indexer.go | |
parent | dd12384f224e98a130511ebc9ffcfb44ead0e736 (diff) | |
download | gitea-4df2ed29f28194513c59733e369152b8f8bc1d36.tar.gz gitea-4df2ed29f28194513c59733e369152b8f8bc1d36.zip |
Refactor: Move PushUpdateOptions (#13363)
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'modules/notification/indexer/indexer.go')
-rw-r--r-- | modules/notification/indexer/indexer.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/notification/indexer/indexer.go b/modules/notification/indexer/indexer.go index 6e848e6318..8293d28570 100644 --- a/modules/notification/indexer/indexer.go +++ b/modules/notification/indexer/indexer.go @@ -123,8 +123,8 @@ func (r *indexerNotifier) NotifyMigrateRepository(doer *models.User, u *models.U } } -func (r *indexerNotifier) NotifyPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits) { - if setting.Indexer.RepoIndexerEnabled && refName == git.BranchPrefix+repo.DefaultBranch { +func (r *indexerNotifier) NotifyPushCommits(pusher *models.User, repo *models.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) { + if setting.Indexer.RepoIndexerEnabled && opts.RefFullName == git.BranchPrefix+repo.DefaultBranch { code_indexer.UpdateRepoIndexer(repo) } if err := stats_indexer.UpdateRepoIndexer(repo); err != nil { @@ -132,8 +132,8 @@ func (r *indexerNotifier) NotifyPushCommits(pusher *models.User, repo *models.Re } } -func (r *indexerNotifier) NotifySyncPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits) { - if setting.Indexer.RepoIndexerEnabled && refName == git.BranchPrefix+repo.DefaultBranch { +func (r *indexerNotifier) NotifySyncPushCommits(pusher *models.User, repo *models.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) { + if setting.Indexer.RepoIndexerEnabled && opts.RefFullName == git.BranchPrefix+repo.DefaultBranch { code_indexer.UpdateRepoIndexer(repo) } if err := stats_indexer.UpdateRepoIndexer(repo); err != nil { |