Improve command shutdown on context cancellation

This commit is contained in:
Michael Eischer
2024-03-30 00:19:58 +01:00
parent 910927670f
commit 31624aeffd
17 changed files with 80 additions and 6 deletions

View File

@@ -713,6 +713,9 @@ func (r *Repository) LoadIndex(ctx context.Context, p *progress.Counter) error {
return errors.New("index uses feature not supported by repository version 1")
}
}
if ctx.Err() != nil {
return ctx.Err()
}
// remove index files from the cache which have been removed in the repo
return r.prepareCache()