mirror of
https://github.com/restic/restic.git
synced 2025-12-04 03:22:23 +00:00
Return real size from SaveBlob
This commit is contained in:
committed by
Michael Eischer
parent
fdc53a9d32
commit
99634c0936
@@ -46,7 +46,7 @@ type Repository interface {
|
||||
LoadUnpacked(ctx context.Context, buf []byte, t FileType, id ID) (data []byte, err error)
|
||||
|
||||
LoadBlob(context.Context, BlobType, ID, []byte) ([]byte, error)
|
||||
SaveBlob(context.Context, BlobType, []byte, ID, bool) (ID, bool, error)
|
||||
SaveBlob(context.Context, BlobType, []byte, ID, bool) (ID, bool, int, error)
|
||||
|
||||
LoadTree(context.Context, ID) (*Tree, error)
|
||||
SaveTree(context.Context, *Tree) (ID, error)
|
||||
|
||||
@@ -52,7 +52,7 @@ func (fs *fakeFileSystem) saveFile(ctx context.Context, rd io.Reader) (blobs IDs
|
||||
|
||||
id := Hash(chunk.Data)
|
||||
if !fs.blobIsKnown(BlobHandle{ID: id, Type: DataBlob}) {
|
||||
_, _, err := fs.repo.SaveBlob(ctx, DataBlob, chunk.Data, id, true)
|
||||
_, _, _, err := fs.repo.SaveBlob(ctx, DataBlob, chunk.Data, id, true)
|
||||
if err != nil {
|
||||
fs.t.Fatalf("error saving chunk: %v", err)
|
||||
}
|
||||
@@ -138,7 +138,7 @@ func (fs *fakeFileSystem) saveTree(ctx context.Context, seed int64, depth int) I
|
||||
return id
|
||||
}
|
||||
|
||||
_, _, err := fs.repo.SaveBlob(ctx, TreeBlob, buf, id, false)
|
||||
_, _, _, err := fs.repo.SaveBlob(ctx, TreeBlob, buf, id, false)
|
||||
if err != nil {
|
||||
fs.t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user