Skip to content

Commit d6a33ce

Browse files
authored
If the default branch is not present do not report error on stats indexing (follow-up of #15546) (#15583)
#15546 doesn't completely fix this problem because the error returned is an ObjectNotExist error not a BranchNotExist error. Add test for ErrObjectNotExist too Fix #15257 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 72e0ad8 commit d6a33ce

File tree

1 file changed

+1
-1
lines changed
  • modules/indexer/stats

1 file changed

+1
-1
lines changed

modules/indexer/stats/db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (db *DBIndexer) Index(id int64) error {
3838
// Get latest commit for default branch
3939
commitID, err := gitRepo.GetBranchCommitID(repo.DefaultBranch)
4040
if err != nil {
41-
if git.IsErrBranchNotExist(err) {
41+
if git.IsErrBranchNotExist(err) || git.IsErrNotExist((err)) {
4242
log.Debug("Unable to get commit ID for defaultbranch %s in %s ... skipping this repository", repo.DefaultBranch, repo.RepoPath())
4343
return nil
4444
}

0 commit comments

Comments
 (0)