diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-16 14:48:39 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-23 09:13:31 +0300 |
commit | 296cebd9d2f567b28aa49a046b3cee29e1e0ca7c (patch) | |
tree | 4966d486ebf259007fdeeea3d2c641f449f2cea8 /internal/gitaly/linguist/linguist.go | |
parent | cc5097c9da20fc5e253255f6be53c93028f5c9e1 (diff) |
command: Introduce options to configure spawned commands
We're about to extend construction of commands so that all members of
the resulting structure will be set at construction time in order to fix
racy access patterns. For this we will need to pass more parameters to
`New()` so that it has all information available at construction time.
Right now the function isn't all that extensive though given that it
only accepts a fixed set of parameters.
Refactor `New()` to instead accept a variable number of `Option`s. As a
first step, convert all parameters currently passed to it to instead use
these new options.
Diffstat (limited to 'internal/gitaly/linguist/linguist.go')
-rw-r--r-- | internal/gitaly/linguist/linguist.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/gitaly/linguist/linguist.go b/internal/gitaly/linguist/linguist.go index 4ac9abfd2..4bc9dbce1 100644 --- a/internal/gitaly/linguist/linguist.go +++ b/internal/gitaly/linguist/linguist.go @@ -95,7 +95,7 @@ func (inst *Instance) startGitLinguist(ctx context.Context, repoPath string, com cmd := exec.Command(bundle, "exec", "bin/gitaly-linguist", "--repository="+repoPath, "--commit="+commitID) cmd.Dir = inst.cfg.Ruby.Dir - internalCmd, err := command.New(ctx, cmd, nil, nil, nil, env.AllowedRubyEnvironment(os.Environ())...) + internalCmd, err := command.New(ctx, cmd, command.WithEnvironment(env.AllowedRubyEnvironment(os.Environ()))) if err != nil { return nil, fmt.Errorf("creating command: %w", err) } |