mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Prevent Stats Indexer reporting error if repo dir missing (#18870)
Repositories missing their directory should not report an error from the stats indexer. Close #18847 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -37,6 +37,9 @@ func (db *DBIndexer) Index(id int64) error { | |||||||
|  |  | ||||||
| 	gitRepo, err := git.OpenRepositoryCtx(ctx, repo.RepoPath()) | 	gitRepo, err := git.OpenRepositoryCtx(ctx, repo.RepoPath()) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  | 		if err.Error() == "no such file or directory" { | ||||||
|  | 			return nil | ||||||
|  | 		} | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	defer gitRepo.Close() | 	defer gitRepo.Close() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user