From cab69fadc13b530f21f910c1d23d146758c365cb Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 28 Feb 2020 08:55:14 +0100 Subject: commands: pass through GIT_PROTOCOL envvar provided by clients Both git-upload-pack and git-receive-pack services inspect the GIT_PROTOCOL environment transferred via SSH in order to decide which protocols are supported by a given client. Currently, we don't use the environment variable at all, though, but instead forward the GitProtocol field of the access verification response. Improve this by passing on the GIT_PROTOCOL environment variable provided by the client as-is. --- internal/command/uploadpack/gitalycall.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/command/uploadpack') diff --git a/internal/command/uploadpack/gitalycall.go b/internal/command/uploadpack/gitalycall.go index 8c8a254..26f87f8 100644 --- a/internal/command/uploadpack/gitalycall.go +++ b/internal/command/uploadpack/gitalycall.go @@ -2,6 +2,7 @@ package uploadpack import ( "context" + "os" "google.golang.org/grpc" @@ -23,7 +24,7 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error { request := &pb.SSHUploadPackRequest{ Repository: &response.Gitaly.Repo, - GitProtocol: response.GitProtocol, + GitProtocol: os.Getenv(commandargs.GitProtocolEnv), GitConfigOptions: response.GitConfigOptions, } -- cgit v1.2.1