restic: change ListBlobs to return PackBlob

PackBlob is a limited interface that only exposes a part of the
information provided by PackedBlob. Most of the changes are switches
from direct value lookups to the interface methods, with a few larger
changes to let the tests still work.
This commit is contained in:
Michael Eischer committed 2026-06-13 17:54:38 +02:00
1 parent 97f1e99ed9
commit ccb5ae1592
15 files changed
+102 -73

No files matched your search

@@ -0,0 +1,17 @@
package repository
import (
"github.com/restic/restic/internal/restic"
)
// BlobsInPack returns index entries for blobs stored in packID, sorted by offset.
func BlobsInPack(repo *Repository, packID restic.ID) restic.Blobs {
var blobs restic.Blobs
for pb := range repo.idx.Values() {
if pb.PackID.Equal(packID) {
blobs = append(blobs, pb.Blob)
}
}
blobs.Sort()
return blobs
}