diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-12-17 14:42:30 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-12-21 08:32:56 +0300 |
commit | 40d86216dfcef16fed56969b2dc1571fd0a1a60d (patch) | |
tree | b7e092efcd128c146b105df495ba5b2b763cbbe4 /internal/git2go/executor.go | |
parent | 3951a24cfa571759bbfa0492dc21f2d7e5694821 (diff) |
git2go: Resolve Git binary path via command factory
The Git binary path for the gitaly-git2go executor is currently resolved
by accessing the configured Git path directly. This is deprecated, where
callers should instead ask the Git command factory for the Git execution
environment.
Convert the git2go executor to accept a Git command factory and query it
for the binary path.
Diffstat (limited to 'internal/git2go/executor.go')
-rw-r--r-- | internal/git2go/executor.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/git2go/executor.go b/internal/git2go/executor.go index c2a4a7bef..575be85e3 100644 --- a/internal/git2go/executor.go +++ b/internal/git2go/executor.go @@ -30,16 +30,16 @@ var ( // Executor executes gitaly-git2go. type Executor struct { binaryPath string - gitBinaryPath string + gitCmdFactory git.CommandFactory locator storage.Locator } // NewExecutor returns a new gitaly-git2go executor using binaries as configured in the given // configuration. -func NewExecutor(cfg config.Cfg, locator storage.Locator) Executor { +func NewExecutor(cfg config.Cfg, gitCmdFactory git.CommandFactory, locator storage.Locator) Executor { return Executor{ binaryPath: filepath.Join(cfg.BinDir, BinaryName), - gitBinaryPath: cfg.Git.BinPath, + gitCmdFactory: gitCmdFactory, locator: locator, } } |