repository: fix parameter order of LookupBlobSize

All methods should use blobType followed by ID.
This commit is contained in:
Michael Eischer committed 2024-05-24 21:33:17 +02:00
1 parent e848ad651a
commit 1266a4932f
17 files changed
+21 -21

No files matched your search

+1 -1
View File
@@ -167,7 +167,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string) error {
}
for _, t := range []restic.BlobType{restic.DataBlob, restic.TreeBlob} {
if _, ok := repo.LookupBlobSize(id, t); !ok {
if _, ok := repo.LookupBlobSize(t, id); !ok {
continue
}
+2 -2
View File
@@ -202,7 +202,7 @@ func copyTree(ctx context.Context, srcRepo restic.Repository, dstRepo restic.Rep
// Do we already have this tree blob?
treeHandle := restic.BlobHandle{ID: tree.ID, Type: restic.TreeBlob}
if _, ok := dstRepo.LookupBlobSize(treeHandle.ID, treeHandle.Type); !ok {
if _, ok := dstRepo.LookupBlobSize(treeHandle.Type, treeHandle.ID); !ok {
// copy raw tree bytes to avoid problems if the serialization changes
enqueue(treeHandle)
}
@@ -212,7 +212,7 @@ func copyTree(ctx context.Context, srcRepo restic.Repository, dstRepo restic.Rep
// Copy the blobs for this file.
for _, blobID := range entry.Content {
h := restic.BlobHandle{Type: restic.DataBlob, ID: blobID}
if _, ok := dstRepo.LookupBlobSize(h.ID, h.Type); !ok {
if _, ok := dstRepo.LookupBlobSize(h.Type, h.ID); !ok {
enqueue(h)
}
}
+1 -1
View File
@@ -156,7 +156,7 @@ func updateBlobs(repo restic.Loader, blobs restic.BlobSet, stats *DiffStat) {
stats.TreeBlobs++
}
size, found := repo.LookupBlobSize(h.ID, h.Type)
size, found := repo.LookupBlobSize(h.Type, h.ID)
if !found {
Warnf("unable to find blob size for %v\n", h)
continue
+1 -1
View File
@@ -97,7 +97,7 @@ func runRepairSnapshots(ctx context.Context, gopts GlobalOptions, opts RepairOpt
var newSize uint64
// check all contents and remove if not available
for _, id := range node.Content {
if size, found := repo.LookupBlobSize(id, restic.DataBlob); !found {
if size, found := repo.LookupBlobSize(restic.DataBlob, id); !found {
ok = false
} else {
newContent = append(newContent, id)
+1 -1
View File
@@ -238,7 +238,7 @@ func statsWalkTree(repo restic.Loader, opts StatsOptions, stats *statsContainer,
}
if _, ok := stats.fileBlobs[nodePath][blobID]; !ok {
// is always a data blob since we're accessing it via a file's Content array
blobSize, found := repo.LookupBlobSize(blobID, restic.DataBlob)
blobSize, found := repo.LookupBlobSize(restic.DataBlob, blobID)
if !found {
return fmt.Errorf("blob %s not found for tree %s", blobID, parentTreeID)
}