mirror of
https://github.com/restic/restic.git
synced 2026-10-30 03:55:42 +00:00
repository: enforce that SaveBlob is called within WithBlobUploader
This is achieved by removing SaveBlob from the public API and only returning it via a uploader object that is passed in by WithBlobUploader.
This commit is contained in:
1 parent
ac4642b479
commit
c6e33c3954
21 files changed
+172
-143
No files matched your search
@@ -107,10 +107,10 @@ func TestEmptyLoadTree(t *testing.T) {
|
||||
|
||||
tree := data.NewTree(0)
|
||||
var id restic.ID
|
||||
rtest.OK(t, repo.WithBlobUploader(context.TODO(), func(ctx context.Context) error {
|
||||
rtest.OK(t, repo.WithBlobUploader(context.TODO(), func(ctx context.Context, uploader restic.BlobSaver) error {
|
||||
var err error
|
||||
// save tree
|
||||
id, err = data.SaveTree(ctx, repo, tree)
|
||||
id, err = data.SaveTree(ctx, uploader, tree)
|
||||
return err
|
||||
}))
|
||||
|
||||
|
||||
Reference in new issue
Block a user