mirror of
https://github.com/restic/restic.git
synced 2026-11-13 22:43:03 +00:00
replace some usages of restic.Repository with more specific interface
This should eventually make it easier to test the code.
This commit is contained in:
1 parent
3424088274
commit
bfb56b78e1
19 files changed
+38
-33
No files matched your search
@@ -120,7 +120,7 @@ func selectBlobs(t *testing.T, repo restic.Repository, p float32) (list1, list2
|
||||
return list1, list2
|
||||
}
|
||||
|
||||
func listPacks(t *testing.T, repo restic.Repository) restic.IDSet {
|
||||
func listPacks(t *testing.T, repo restic.Lister) restic.IDSet {
|
||||
list := restic.NewIDSet()
|
||||
err := repo.List(context.TODO(), restic.PackFile, func(id restic.ID, size int64) error {
|
||||
list.Insert(id)
|
||||
|
||||
@@ -229,7 +229,7 @@ func TestRepositoryLoadIndex(t *testing.T) {
|
||||
}
|
||||
|
||||
// loadIndex loads the index id from backend and returns it.
|
||||
func loadIndex(ctx context.Context, repo restic.Repository, id restic.ID) (*index.Index, error) {
|
||||
func loadIndex(ctx context.Context, repo restic.LoaderUnpacked, id restic.ID) (*index.Index, error) {
|
||||
buf, err := repo.LoadUnpacked(ctx, restic.IndexFile, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user