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>2020-12-15 13:02:51 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-12-17 19:29:53 +0300
commitb140b7b4e1b7d6941264706e68e802ea61f04f04 (patch)
treea0f2cc940c444513150310dc47d0845625cca374 /cmd/gitaly-hooks
parentd8f65f062c39af061656b477ca7413db0d93d907 (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.go2
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_") {