mirror of
https://github.com/restic/restic.git
synced 2026-10-18 15:38:12 +00:00
repository: replace HasBlob with LookupBlobSize
This commit is contained in:
1 parent
8f1e70cd9b
commit
0aa5c53842
5 files changed
+5
-11
No files matched your search
@@ -167,8 +167,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string) error {
|
||||
}
|
||||
|
||||
for _, t := range []restic.BlobType{restic.DataBlob, restic.TreeBlob} {
|
||||
bh := restic.BlobHandle{ID: id, Type: t}
|
||||
if !repo.HasBlob(bh) {
|
||||
if _, ok := repo.LookupBlobSize(id, t); !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -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 !dstRepo.HasBlob(treeHandle) {
|
||||
if _, ok := dstRepo.LookupBlobSize(treeHandle.ID, treeHandle.Type); !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 !dstRepo.HasBlob(h) {
|
||||
if _, ok := dstRepo.LookupBlobSize(h.ID, h.Type); !ok {
|
||||
enqueue(h)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user