From 50ec408302dabf43b00aab44bfa897f83193788f Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 24 May 2024 23:06:44 +0200 Subject: [PATCH] index: move to repository package --- cmd/restic/cmd_debug.go | 2 +- cmd/restic/cmd_list.go | 2 +- cmd/restic/cmd_repair_index_integration_test.go | 2 +- internal/checker/checker.go | 2 +- internal/{ => repository}/index/associated_data.go | 0 internal/{ => repository}/index/associated_data_test.go | 0 internal/{ => repository}/index/index.go | 0 internal/{ => repository}/index/index_parallel.go | 0 internal/{ => repository}/index/index_parallel_test.go | 4 ++-- internal/{ => repository}/index/index_test.go | 2 +- internal/{ => repository}/index/indexmap.go | 0 internal/{ => repository}/index/indexmap_test.go | 0 internal/{ => repository}/index/master_index.go | 0 internal/{ => repository}/index/master_index_test.go | 2 +- internal/{ => repository}/index/testing.go | 0 internal/repository/prune.go | 2 +- internal/repository/repair_index.go | 2 +- internal/repository/repository.go | 2 +- internal/repository/repository_test.go | 2 +- 19 files changed, 12 insertions(+), 12 deletions(-) rename internal/{ => repository}/index/associated_data.go (100%) rename internal/{ => repository}/index/associated_data_test.go (100%) rename internal/{ => repository}/index/index.go (100%) rename internal/{ => repository}/index/index_parallel.go (100%) rename internal/{ => repository}/index/index_parallel_test.go (90%) rename internal/{ => repository}/index/index_test.go (99%) rename internal/{ => repository}/index/indexmap.go (100%) rename internal/{ => repository}/index/indexmap_test.go (100%) rename internal/{ => repository}/index/master_index.go (100%) rename internal/{ => repository}/index/master_index_test.go (99%) rename internal/{ => repository}/index/testing.go (100%) diff --git a/cmd/restic/cmd_debug.go b/cmd/restic/cmd_debug.go index 7b0cdb53e..ff1e4c28b 100644 --- a/cmd/restic/cmd_debug.go +++ b/cmd/restic/cmd_debug.go @@ -22,9 +22,9 @@ import ( "github.com/restic/restic/internal/crypto" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/pack" "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" ) diff --git a/cmd/restic/cmd_list.go b/cmd/restic/cmd_list.go index 27f59b4ab..6f4430420 100644 --- a/cmd/restic/cmd_list.go +++ b/cmd/restic/cmd_list.go @@ -4,7 +4,7 @@ import ( "context" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" "github.com/spf13/cobra" diff --git a/cmd/restic/cmd_repair_index_integration_test.go b/cmd/restic/cmd_repair_index_integration_test.go index e11b2f91b..9bfc93b40 100644 --- a/cmd/restic/cmd_repair_index_integration_test.go +++ b/cmd/restic/cmd_repair_index_integration_test.go @@ -10,7 +10,7 @@ import ( "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" "github.com/restic/restic/internal/ui/termstatus" diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 61c017414..fb6fbacd5 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -12,9 +12,9 @@ import ( "github.com/restic/restic/internal/backend/s3" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/pack" "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/ui/progress" "golang.org/x/sync/errgroup" diff --git a/internal/index/associated_data.go b/internal/repository/index/associated_data.go similarity index 100% rename from internal/index/associated_data.go rename to internal/repository/index/associated_data.go diff --git a/internal/index/associated_data_test.go b/internal/repository/index/associated_data_test.go similarity index 100% rename from internal/index/associated_data_test.go rename to internal/repository/index/associated_data_test.go diff --git a/internal/index/index.go b/internal/repository/index/index.go similarity index 100% rename from internal/index/index.go rename to internal/repository/index/index.go diff --git a/internal/index/index_parallel.go b/internal/repository/index/index_parallel.go similarity index 100% rename from internal/index/index_parallel.go rename to internal/repository/index/index_parallel.go diff --git a/internal/index/index_parallel_test.go b/internal/repository/index/index_parallel_test.go similarity index 90% rename from internal/index/index_parallel_test.go rename to internal/repository/index/index_parallel_test.go index 61b0aad63..38dafb507 100644 --- a/internal/index/index_parallel_test.go +++ b/internal/repository/index/index_parallel_test.go @@ -6,13 +6,13 @@ import ( "testing" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) -var repoFixture = filepath.Join("..", "repository", "testdata", "test-repo.tar.gz") +var repoFixture = filepath.Join("..", "testdata", "test-repo.tar.gz") func TestRepositoryForAllIndexes(t *testing.T) { repo, _, cleanup := repository.TestFromFixture(t, repoFixture) diff --git a/internal/index/index_test.go b/internal/repository/index/index_test.go similarity index 99% rename from internal/index/index_test.go rename to internal/repository/index/index_test.go index 1a487f82f..bf752d3d3 100644 --- a/internal/index/index_test.go +++ b/internal/repository/index/index_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/restic/restic/internal/feature" - "github.com/restic/restic/internal/index" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) diff --git a/internal/index/indexmap.go b/internal/repository/index/indexmap.go similarity index 100% rename from internal/index/indexmap.go rename to internal/repository/index/indexmap.go diff --git a/internal/index/indexmap_test.go b/internal/repository/index/indexmap_test.go similarity index 100% rename from internal/index/indexmap_test.go rename to internal/repository/index/indexmap_test.go diff --git a/internal/index/master_index.go b/internal/repository/index/master_index.go similarity index 100% rename from internal/index/master_index.go rename to internal/repository/index/master_index.go diff --git a/internal/index/master_index_test.go b/internal/repository/index/master_index_test.go similarity index 99% rename from internal/index/master_index_test.go rename to internal/repository/index/master_index_test.go index 7a2487cd4..23185962e 100644 --- a/internal/index/master_index_test.go +++ b/internal/repository/index/master_index_test.go @@ -10,8 +10,8 @@ import ( "github.com/restic/restic/internal/checker" "github.com/restic/restic/internal/crypto" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) diff --git a/internal/index/testing.go b/internal/repository/index/testing.go similarity index 100% rename from internal/index/testing.go rename to internal/repository/index/testing.go diff --git a/internal/repository/prune.go b/internal/repository/prune.go index 1dae68c15..6f2182ac5 100644 --- a/internal/repository/prune.go +++ b/internal/repository/prune.go @@ -7,8 +7,8 @@ import ( "sort" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/pack" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/ui/progress" ) diff --git a/internal/repository/repair_index.go b/internal/repository/repair_index.go index e01131923..868b0a894 100644 --- a/internal/repository/repair_index.go +++ b/internal/repository/repair_index.go @@ -3,8 +3,8 @@ package repository import ( "context" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/pack" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/ui/progress" ) diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 7233c7854..97fc0f506 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -19,8 +19,8 @@ import ( "github.com/restic/restic/internal/crypto" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/pack" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/ui/progress" diff --git a/internal/repository/repository_test.go b/internal/repository/repository_test.go index 679eaaaab..c06d4f25b 100644 --- a/internal/repository/repository_test.go +++ b/internal/repository/repository_test.go @@ -19,8 +19,8 @@ import ( "github.com/restic/restic/internal/backend/mem" "github.com/restic/restic/internal/crypto" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/index" "github.com/restic/restic/internal/repository" + "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/test" rtest "github.com/restic/restic/internal/test"