From 598511b311e8e15a2f382740495c4532fac8217d Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Wed, 13 Nov 2019 20:16:37 -0300 Subject: [PATCH] Support GL_CONFIG_OPTIONS environment variable in git upload-pack --- cmd/gitaly-ssh/upload_pack.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/gitaly-ssh/upload_pack.go b/cmd/gitaly-ssh/upload_pack.go index c6fbf4b89af..ea005a4e5df 100644 --- a/cmd/gitaly-ssh/upload_pack.go +++ b/cmd/gitaly-ssh/upload_pack.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os" + "strings" "github.com/golang/protobuf/jsonpb" "gitlab.com/gitlab-org/gitaly/client" @@ -17,6 +18,12 @@ func uploadPack(ctx context.Context, conn *grpc.ClientConn, req string) (int32, return 0, fmt.Errorf("json unmarshal: %v", err) } + gitConfig := os.Getenv("GL_CONFIG_OPTIONS") + + if len(gitConfig) > 0 { + request.GitConfigOptions = append(request.GitConfigOptions, strings.Split(gitConfig, " ")...) + } + ctx, cancel := context.WithCancel(ctx) defer cancel() -- GitLab