diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-15 13:02:51 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-17 19:29:53 +0300 |
commit | b140b7b4e1b7d6941264706e68e802ea61f04f04 (patch) | |
tree | a0f2cc940c444513150310dc47d0845625cca374 /cmd/gitaly-hooks | |
parent | d8f65f062c39af061656b477ca7413db0d93d907 (diff) |
command: Filter `AllowedEnviroment()` via explicit slice
The `AllowedEnvironment()` function currently operates on the real
environment directly, which makes it quite inflexible as one cannot
filter a different environment. As we're about to move filtering of the
allowed environment into the hooks manager, which only has those
variables in the incoming environment slice, this commit refactors the
function to instead filter a given slice.
Diffstat (limited to 'cmd/gitaly-hooks')
-rw-r--r-- | cmd/gitaly-hooks/hooks.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/gitaly-hooks/hooks.go b/cmd/gitaly-hooks/hooks.go index 99598b2b4..b1164f410 100644 --- a/cmd/gitaly-hooks/hooks.go +++ b/cmd/gitaly-hooks/hooks.go @@ -221,7 +221,7 @@ func dialGitaly(payload git.HooksPayload) (*grpc.ClientConn, error) { } func hookEnvironment(payload git.HooksPayload) ([]string, error) { - environment := command.AllowedEnvironment() + environment := command.AllowedEnvironment(os.Environ()) for _, kv := range os.Environ() { if strings.HasPrefix(kv, "GL_") { |