check: split index/pack check into repository package

This commit is contained in:
Michael Eischer
2025-09-28 14:13:53 +02:00
parent bfc2ce97fd
commit 82971ad7f0
4 changed files with 308 additions and 283 deletions

View File

@@ -257,10 +257,10 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
errorsFound := false
for _, hint := range hints {
switch hint.(type) {
case *checker.ErrDuplicatePacks:
case *repository.ErrDuplicatePacks:
printer.S("%s", hint.Error())
summary.HintRepairIndex = true
case *checker.ErrMixedPack:
case *repository.ErrMixedPack:
printer.S("%s", hint.Error())
summary.HintPrune = true
default:
@@ -295,7 +295,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
go chkr.Packs(ctx, errChan)
for err := range errChan {
var packErr *checker.PackError
var packErr *repository.PackError
if errors.As(err, &packErr) {
if packErr.Orphaned {
orphanedPacks++