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:
Michael Eischer
2024-01-19 22:44:50 +01:00
parent 3424088274
commit bfb56b78e1
19 changed files with 38 additions and 33 deletions

View File

@@ -40,7 +40,7 @@ type Dir struct {
ModTime time.Time
}
func saveFile(t testing.TB, repo restic.Repository, node File) restic.ID {
func saveFile(t testing.TB, repo restic.BlobSaver, node File) restic.ID {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -52,7 +52,7 @@ func saveFile(t testing.TB, repo restic.Repository, node File) restic.ID {
return id
}
func saveDir(t testing.TB, repo restic.Repository, nodes map[string]Node, inode uint64) restic.ID {
func saveDir(t testing.TB, repo restic.BlobSaver, nodes map[string]Node, inode uint64) restic.ID {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()