repository: remove IsMixedPack and add replacement for checker

Repositories with mixed packs are probably quite rare by now. When
loading data blobs from a mixed pack file, this will no longer trigger
caching that file. However, usually tree blobs are accessed first such
that this shouldn't make much of a difference.

The checker gets a simpler replacement.
This commit is contained in:
Michael Eischer
2022-06-12 14:45:42 +02:00
parent a61fbd287a
commit ddcf549eba
5 changed files with 24 additions and 57 deletions

View File

@@ -277,12 +277,7 @@ func (r *Repository) LoadBlob(ctx context.Context, t restic.BlobType, id restic.
}
// load blob from pack
bt := t
if r.idx.IsMixedPack(blob.PackID) {
bt = restic.InvalidBlob
}
h := restic.Handle{Type: restic.PackFile,
Name: blob.PackID.String(), ContainedBlobType: bt}
h := restic.Handle{Type: restic.PackFile, Name: blob.PackID.String(), ContainedBlobType: t}
switch {
case cap(buf) < int(blob.Length):