summaryrefslogtreecommitdiffstats
path: root/modules/indexer/stats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-04-22 16:35:29 +0100
committerGitHub <noreply@github.com>2021-04-22 17:35:29 +0200
commitd6a33cef23c3be2c2b5179c58ad269cd80f8d478 (patch)
treec52243ef1fd27d8affccbbb1fd56a4dc8794d4fa /modules/indexer/stats
parent72e0ad8000412b005fad0daa3a5f91c97b791ec8 (diff)
downloadgitea-d6a33cef23c3be2c2b5179c58ad269cd80f8d478.tar.gz
gitea-d6a33cef23c3be2c2b5179c58ad269cd80f8d478.zip
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 <art27@cantab.net>
Diffstat (limited to 'modules/indexer/stats')
-rw-r--r--modules/indexer/stats/db.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/indexer/stats/db.go b/modules/indexer/stats/db.go
index 3935c3ba75..976bf2d632 100644
--- a/modules/indexer/stats/db.go
+++ b/modules/indexer/stats/db.go
@@ -38,7 +38,7 @@ func (db *DBIndexer) Index(id int64) error {
// Get latest commit for default branch
commitID, err := gitRepo.GetBranchCommitID(repo.DefaultBranch)
if err != nil {
- if git.IsErrBranchNotExist(err) {
+ if git.IsErrBranchNotExist(err) || git.IsErrNotExist((err)) {
log.Debug("Unable to get commit ID for defaultbranch %s in %s ... skipping this repository", repo.DefaultBranch, repo.RepoPath())
return nil
}