Skip to content

Commit d3bf78b

Browse files
committed
Prevent Stats Indexer reporting error if repo dir missing
Repositories missing their directory should not report an error from the stats indexer. Close go-gitea#18847 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 2b5e013 commit d3bf78b

File tree

1 file changed

+3
-0
lines changed
  • modules/indexer/stats

1 file changed

+3
-0
lines changed

modules/indexer/stats/db.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func (db *DBIndexer) Index(id int64) error {
3737

3838
gitRepo, err := git.OpenRepositoryCtx(ctx, repo.RepoPath())
3939
if err != nil {
40+
if err.Error() == "no such file or directory" {
41+
return nil
42+
}
4043
return err
4144
}
4245
defer gitRepo.Close()

0 commit comments

Comments
 (0)