mirror of
https://github.com/restic/restic.git
synced 2026-11-08 16:13:38 +00:00
repository: change LoadBlob, LookupBlob and LookupBlobSize to BlobHandles (#21857)
This commit is contained in:
1 parent
71f38d266c
commit
7d36449ea8
27 files changed
+85
-85
No files matched your search
@@ -202,11 +202,11 @@ func TestLoadAllSnapshots(ctx context.Context, repo restic.ListerLoaderUnpacked,
|
||||
// TestTreeMap returns the trees from the map on LoadTree.
|
||||
type TestTreeMap map[restic.ID][]byte
|
||||
|
||||
func (t TestTreeMap) LoadBlob(_ context.Context, tpe restic.BlobType, id restic.ID, _ []byte) ([]byte, error) {
|
||||
if tpe != restic.TreeBlob {
|
||||
func (t TestTreeMap) LoadBlob(_ context.Context, bh restic.BlobHandle, _ []byte) ([]byte, error) {
|
||||
if bh.Type != restic.TreeBlob {
|
||||
return nil, fmt.Errorf("can only load trees")
|
||||
}
|
||||
tree, ok := t[id]
|
||||
tree, ok := t[bh.ID]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("tree not found")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user