diff options
Diffstat (limited to 'internal/git/localrepo/repo_test.go')
-rw-r--r-- | internal/git/localrepo/repo_test.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/internal/git/localrepo/repo_test.go b/internal/git/localrepo/repo_test.go index 67da2ac34..4a5ab58e1 100644 --- a/internal/git/localrepo/repo_test.go +++ b/internal/git/localrepo/repo_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/internal/git" + "gitlab.com/gitlab-org/gitaly/internal/git/catfile" "gitlab.com/gitlab-org/gitaly/internal/git/gittest" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/testhelper/testcfg" @@ -18,14 +19,16 @@ func TestRepo(t *testing.T) { gittest.TestRepository(t, cfg, func(t testing.TB, pbRepo *gitalypb.Repository) git.Repository { t.Helper() - return New(git.NewExecCommandFactory(cfg), pbRepo, cfg) + gitCmdFactory := git.NewExecCommandFactory(cfg) + return New(gitCmdFactory, catfile.NewCache(cfg), pbRepo, cfg) }) } func TestRepo_Path(t *testing.T) { t.Run("valid repository", func(t *testing.T) { cfg, repoProto, repoPath := testcfg.BuildWithRepo(t) - repo := New(git.NewExecCommandFactory(cfg), repoProto, cfg) + gitCmdFactory := git.NewExecCommandFactory(cfg) + repo := New(gitCmdFactory, catfile.NewCache(cfg), repoProto, cfg) path, err := repo.Path() require.NoError(t, err) @@ -34,7 +37,8 @@ func TestRepo_Path(t *testing.T) { t.Run("deleted repository", func(t *testing.T) { cfg, repoProto, repoPath := testcfg.BuildWithRepo(t) - repo := New(git.NewExecCommandFactory(cfg), repoProto, cfg) + gitCmdFactory := git.NewExecCommandFactory(cfg) + repo := New(gitCmdFactory, catfile.NewCache(cfg), repoProto, cfg) require.NoError(t, os.RemoveAll(repoPath)) @@ -44,7 +48,8 @@ func TestRepo_Path(t *testing.T) { t.Run("non-git repository", func(t *testing.T) { cfg, repoProto, repoPath := testcfg.BuildWithRepo(t) - repo := New(git.NewExecCommandFactory(cfg), repoProto, cfg) + gitCmdFactory := git.NewExecCommandFactory(cfg) + repo := New(gitCmdFactory, catfile.NewCache(cfg), repoProto, cfg) // Recreate the repository as a simple empty directory to simulate // that the repository is in a partially-created state. |