repository: unwrap BlobHandle parameters of LookupBlob

The method now uses the same parameters as LookupBlobSize.
This commit is contained in:
Michael Eischer
2024-05-24 21:33:17 +02:00
parent 1266a4932f
commit 864995271e
10 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ func copyTree(ctx context.Context, srcRepo restic.Repository, dstRepo restic.Rep
packList := restic.NewIDSet()
enqueue := func(h restic.BlobHandle) {
pb := srcRepo.LookupBlob(h)
pb := srcRepo.LookupBlob(h.Type, h.ID)
copyBlobs.Insert(h)
for _, p := range pb {
packList.Insert(p.PackID)
+1 -1
View File
@@ -509,7 +509,7 @@ func (f *Finder) findObjectPack(id string, t restic.BlobType) {
return
}
blobs := f.repo.LookupBlob(restic.BlobHandle{ID: rid, Type: t})
blobs := f.repo.LookupBlob(t, rid)
if len(blobs) == 0 {
Printf("Object %s not found in the index\n", rid.Str())
return
+1 -1
View File
@@ -124,7 +124,7 @@ func runStats(ctx context.Context, opts StatsOptions, gopts GlobalOptions, args
if opts.countMode == countModeRawData {
// the blob handles have been collected, but not yet counted
for blobHandle := range stats.blobs {
pbs := repo.LookupBlob(blobHandle)
pbs := repo.LookupBlob(blobHandle.Type, blobHandle.ID)
if len(pbs) == 0 {
return fmt.Errorf("blob %v not found", blobHandle)
}