Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-15 15:50:22 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-20 07:32:39 +0300
commit30a4417ddb8a570a6f999ab60d66f742829d0059 (patch)
tree5688c0d8781486c902831797d57d412afd971159 /internal/gitaly/linguist/linguist.go
parentfb1cd5ff1274d10d9bebb2a714e2dcc19375f5aa (diff)
command: Accept command arguments instead of an `exec.Cmd`
In order to spawn a command via our command package the caller has to pass in an `exec.Cmd`. This calling convention is weird and opens up the window for unexpected behaviour in case the caller passes in a command that is initialized with state unexpected by the command package. Refactor the package to instead accept a set of arguments. Like this, the assembled `exec.Cmd` is fully controlled by the command package.
Diffstat (limited to 'internal/gitaly/linguist/linguist.go')
-rw-r--r--internal/gitaly/linguist/linguist.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/gitaly/linguist/linguist.go b/internal/gitaly/linguist/linguist.go
index 226972fed..145e4f8b9 100644
--- a/internal/gitaly/linguist/linguist.go
+++ b/internal/gitaly/linguist/linguist.go
@@ -107,7 +107,7 @@ func (inst *Instance) startGitLinguist(ctx context.Context, repoPath string, com
return nil, fmt.Errorf("finding bundle executable: %w", err)
}
- cmd := exec.Command(bundle, "exec", "bin/gitaly-linguist", "--repository="+repoPath, "--commit="+commitID)
+ cmd := []string{bundle, "exec", "bin/gitaly-linguist", "--repository=" + repoPath, "--commit=" + commitID}
internalCmd, err := command.New(ctx, cmd,
command.WithDir(inst.cfg.Ruby.Dir),