summaryrefslogtreecommitdiff
path: root/internal/command/command.go
diff options
context:
space:
mode:
authorLucas Charles <me@lucascharles.me>2021-02-17 13:49:46 -0800
committerLucas Charles <me@lucascharles.me>2021-03-15 13:47:11 -0700
commitd539068dc372e46d10adee89e9b96b59156a2bb6 (patch)
tree9c37f5ade4a95622b30a7a47befcb46b185b9682 /internal/command/command.go
parente79f115d93a9f00f3e4f8a22ec770fdf4c3e1947 (diff)
downloadgitlab-shell-d539068dc372e46d10adee89e9b96b59156a2bb6.tar.gz
chore: Refactor env introspection to rely on command initialization496-move-env-introspection-to-sshenv
Refactors introspection of execution environment to rely on per-connection state (`gitlab-shell`) or per request (`gitlab-sshd`) Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/496
Diffstat (limited to 'internal/command/command.go')
-rw-r--r--internal/command/command.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/command/command.go b/internal/command/command.go
index c0f9090..bb430b7 100644
--- a/internal/command/command.go
+++ b/internal/command/command.go
@@ -20,6 +20,7 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/internal/command/uploadpack"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
"gitlab.com/gitlab-org/gitlab-shell/internal/executable"
+ "gitlab.com/gitlab-org/gitlab-shell/internal/sshenv"
"gitlab.com/gitlab-org/labkit/correlation"
"gitlab.com/gitlab-org/labkit/log"
"gitlab.com/gitlab-org/labkit/tracing"
@@ -29,8 +30,8 @@ type Command interface {
Execute(ctx context.Context) error
}
-func New(e *executable.Executable, arguments []string, config *config.Config, readWriter *readwriter.ReadWriter) (Command, error) {
- args, err := commandargs.Parse(e, arguments)
+func New(e *executable.Executable, arguments []string, env sshenv.Env, config *config.Config, readWriter *readwriter.ReadWriter) (Command, error) {
+ args, err := commandargs.Parse(e, arguments, env)
if err != nil {
return nil, err
}