diff options
Diffstat (limited to 'internal/git/localrepo')
-rw-r--r-- | internal/git/localrepo/config_test.go | 11 | ||||
-rw-r--r-- | internal/git/localrepo/objects_test.go | 2 | ||||
-rw-r--r-- | internal/git/localrepo/remote_test.go | 6 |
3 files changed, 5 insertions, 14 deletions
diff --git a/internal/git/localrepo/config_test.go b/internal/git/localrepo/config_test.go index f945c4e6a..f44bf682e 100644 --- a/internal/git/localrepo/config_test.go +++ b/internal/git/localrepo/config_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/internal/git" "gitlab.com/gitlab-org/gitaly/internal/git/gittest" - "gitlab.com/gitlab-org/gitaly/internal/gitaly/config" "gitlab.com/gitlab-org/gitaly/internal/helper/text" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/internal/testhelper/testcfg" @@ -21,21 +20,13 @@ func setupRepoConfig(t *testing.T) (Config, string) { cfg := testcfg.Build(t) - repoProto, repoPath, cleanup := gittest.InitBareRepoAt(t, cfg.Storages[0]) + repoProto, repoPath, cleanup := gittest.InitBareRepoAt(t, cfg, cfg.Storages[0]) t.Cleanup(cleanup) repo := New(git.NewExecCommandFactory(cfg), repoProto, cfg) return repo.Config(), repoPath } -func TestRepo_Config(t *testing.T) { - bareRepo, _, cleanup := gittest.InitBareRepo(t) - defer cleanup() - - repo := New(nil, bareRepo, config.Cfg{}) - require.Equal(t, Config{repo: repo}, repo.Config()) -} - func TestBuildConfigAddOptsFlags(t *testing.T) { for _, tc := range []struct { desc string diff --git a/internal/git/localrepo/objects_test.go b/internal/git/localrepo/objects_test.go index a25305ba7..18d18ca84 100644 --- a/internal/git/localrepo/objects_test.go +++ b/internal/git/localrepo/objects_test.go @@ -30,7 +30,7 @@ func setupRepo(t *testing.T, bare bool) (*Repo, string) { var repoPath string var repoCleanUp func() if bare { - repoProto, repoPath, repoCleanUp = gittest.InitBareRepoAt(t, cfg.Storages[0]) + repoProto, repoPath, repoCleanUp = gittest.InitBareRepoAt(t, cfg, cfg.Storages[0]) } else { repoProto, repoPath, repoCleanUp = gittest.CloneRepoAtStorage(t, cfg.Storages[0], t.Name()) } diff --git a/internal/git/localrepo/remote_test.go b/internal/git/localrepo/remote_test.go index 14659e816..bd424ecdf 100644 --- a/internal/git/localrepo/remote_test.go +++ b/internal/git/localrepo/remote_test.go @@ -32,7 +32,7 @@ func setupRepoRemote(t *testing.T, bare bool) (Remote, string) { var repoPath string var repoCleanUp func() if bare { - repoProto, repoPath, repoCleanUp = gittest.InitBareRepoAt(t, cfg.Storages[0]) + repoProto, repoPath, repoCleanUp = gittest.InitBareRepoAt(t, cfg, cfg.Storages[0]) } else { repoProto, repoPath, repoCleanUp = gittest.CloneRepoAtStorage(t, cfg.Storages[0], t.Name()) } @@ -308,7 +308,7 @@ func TestRepo_FetchRemote(t *testing.T) { initBareWithRemote := func(t *testing.T, remote string) (*Repo, string, testhelper.Cleanup) { t.Helper() - testRepo, testRepoPath, cleanup := gittest.InitBareRepoAt(t, cfg.Storages[0]) + testRepo, testRepoPath, cleanup := gittest.InitBareRepoAt(t, cfg, cfg.Storages[0]) cmd := exec.Command(cfg.Git.BinPath, "-C", testRepoPath, "remote", "add", remote, remoteRepoPath) err := cmd.Run() @@ -524,7 +524,7 @@ if [ -z ${GIT_SSH_COMMAND+x} ];then rm -f %q ;else echo -n "$GIT_SSH_COMMAND" > }, } { t.Run(tc.desc, func(t *testing.T) { - pushRepoPb, pushRepoPath, _ := gittest.InitBareRepoAt(t, cfg.Storages[0]) + pushRepoPb, pushRepoPath, _ := gittest.InitBareRepoAt(t, cfg, cfg.Storages[0]) pushRepo := New(git.NewExecCommandFactory(cfg), pushRepoPb, cfg) if tc.setupPushRepo != nil { |