Skip to content

Commit

Permalink
Fix repo indexer not updating upon push (go-gitea#9957)
Browse files Browse the repository at this point in the history
* Fix check for push on default branch

* restart CI

Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
2 people authored and lafriks committed Jan 24, 2020
1 parent 514be72 commit dbd1fae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/notification/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package indexer

import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
code_indexer "code.gitea.io/gitea/modules/indexer/code"
issue_indexer "code.gitea.io/gitea/modules/indexer/issues"
"code.gitea.io/gitea/modules/log"
Expand Down Expand Up @@ -119,7 +120,7 @@ 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 == repo.DefaultBranch {
if setting.Indexer.RepoIndexerEnabled && refName == git.BranchPrefix+repo.DefaultBranch {
code_indexer.UpdateRepoIndexer(repo)
}
}
Expand Down

0 comments on commit dbd1fae

Please sign in to comment.