check: cleanup s3 legacy detection

This commit is contained in:
Michael Eischer 2024-01-19 23:32:17 +01:00
parent 1dfd854769
commit 246559e654
1 changed files with 2 additions and 12 deletions

View File

@ -14,7 +14,6 @@ import (
"github.com/minio/sha256-simd"
"github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/backend/s3"
"github.com/restic/restic/internal/cache"
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/hashing"
@ -241,17 +240,8 @@ func IsOrphanedPack(err error) bool {
}
func isS3Legacy(b backend.Backend) bool {
// unwrap cache
if be, ok := b.(*cache.Backend); ok {
b = be.Backend
}
be, ok := b.(*s3.Backend)
if !ok {
return false
}
return be.Layout.Name() == "s3legacy"
be := backend.AsBackend[*s3.Backend](b)
return be != nil && be.Layout.Name() == "s3legacy"
}
// Packs checks that all packs referenced in the index are still available and