Allow exit when caculating language in gogit version

This commit is contained in:
Lunny Xiao 2025-06-04 17:45:07 -07:00
parent 57ba66822a
commit 9363b591ed

View File

@ -59,6 +59,13 @@ func CalcLanguageStats(ctx context.Context, repo *git_module.Repository, commitI
firstExcludedLanguageSize := int64(0)
err = tree.Files().ForEach(func(f *object.File) error {
select {
case <-ctx.Done():
return ctx.Err()
default:
return nil
}
if f.Size == 0 {
return nil
}