From c44b21d3665e9b78897e35cdbb03b632d7f37573 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 17 Jul 2022 13:45:42 +0200 Subject: [PATCH] restorer: extract hardlinks index from restic package --- internal/{restic => restorer}/hardlinks_index.go | 2 +- internal/{restic => restorer}/hardlinks_index_test.go | 6 +++--- internal/restorer/restorer.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename internal/{restic => restorer}/hardlinks_index.go (98%) rename internal/{restic => restorer}/hardlinks_index_test.go (85%) diff --git a/internal/restic/hardlinks_index.go b/internal/restorer/hardlinks_index.go similarity index 98% rename from internal/restic/hardlinks_index.go rename to internal/restorer/hardlinks_index.go index 0874f32a4..9cf45975a 100644 --- a/internal/restic/hardlinks_index.go +++ b/internal/restorer/hardlinks_index.go @@ -1,4 +1,4 @@ -package restic +package restorer import ( "sync" diff --git a/internal/restic/hardlinks_index_test.go b/internal/restorer/hardlinks_index_test.go similarity index 85% rename from internal/restic/hardlinks_index_test.go rename to internal/restorer/hardlinks_index_test.go index 8040d657f..75a2b83ee 100644 --- a/internal/restic/hardlinks_index_test.go +++ b/internal/restorer/hardlinks_index_test.go @@ -1,16 +1,16 @@ -package restic_test +package restorer_test import ( "testing" - "github.com/restic/restic/internal/restic" + "github.com/restic/restic/internal/restorer" rtest "github.com/restic/restic/internal/test" ) // TestHardLinks contains various tests for HardlinkIndex. func TestHardLinks(t *testing.T) { - idx := restic.NewHardlinkIndex() + idx := restorer.NewHardlinkIndex() idx.Add(1, 2, "inode1-file1-on-device2") idx.Add(2, 3, "inode2-file2-on-device3") diff --git a/internal/restorer/restorer.go b/internal/restorer/restorer.go index 5a3f91368..a15a7bb9e 100644 --- a/internal/restorer/restorer.go +++ b/internal/restorer/restorer.go @@ -218,7 +218,7 @@ func (res *Restorer) RestoreTo(ctx context.Context, dst string) error { } } - idx := restic.NewHardlinkIndex() + idx := NewHardlinkIndex() filerestorer := newFileRestorer(dst, res.repo.Backend().Load, res.repo.Key(), res.repo.Index().Lookup, res.repo.Connections()) filerestorer.Error = res.Error