diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-19 17:56:52 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-19 17:56:52 +0300 |
commit | 5de775678984e09fbd9c52882e7e473f33d55dd8 (patch) | |
tree | 5e2ce5f4edd453f54558fa46a07d0543f5b98fa1 /internal/git2go | |
parent | 758a1a5d356389e169c3ee8aeafbc6ad3c5dc5a2 (diff) |
git: Pass Gitaly config when creating new repositories
The `LocalRepository` abstraction indirectly depends on the global
Gitaly configuration as it uses `NewCommand()` to run commands, which in
turn uses the global configuration to resolve repository locations.
As a preparatory step, this commit makes the configuration available to
the `LocalRepository` structure by passing it as an argument of
`NewRepository()`. Note that the configuration is currently not yet
used.
Diffstat (limited to 'internal/git2go')
-rw-r--r-- | internal/git2go/apply_test.go | 2 | ||||
-rw-r--r-- | internal/git2go/commit_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/git2go/apply_test.go b/internal/git2go/apply_test.go index fe12d603d..07680ee0e 100644 --- a/internal/git2go/apply_test.go +++ b/internal/git2go/apply_test.go @@ -17,7 +17,7 @@ func TestExecutor_Apply(t *testing.T) { pbRepo, repoPath, clean := testhelper.InitBareRepo(t) defer clean() - repo := git.NewRepository(pbRepo) + repo := git.NewRepository(pbRepo, config.Config) executor := New(filepath.Join(config.Config.BinDir, "gitaly-git2go"), config.Config.Git.BinPath) ctx, cancel := testhelper.Context() diff --git a/internal/git2go/commit_test.go b/internal/git2go/commit_test.go index 215cc59da..8dd3dd3a2 100644 --- a/internal/git2go/commit_test.go +++ b/internal/git2go/commit_test.go @@ -55,7 +55,7 @@ func TestExecutor_Commit(t *testing.T) { pbRepo, repoPath, clean := testhelper.InitBareRepo(t) defer clean() - repo := git.NewRepository(pbRepo) + repo := git.NewRepository(pbRepo, config.Config) originalFile, err := repo.WriteBlob(ctx, "file", bytes.NewBufferString("original")) require.NoError(t, err) |