diff options
-rw-r--r-- | internal/command/commandargs/shell.go | 2 | ||||
-rw-r--r-- | internal/command/receivepack/gitalycall.go | 3 | ||||
-rw-r--r-- | internal/command/uploadpack/gitalycall.go | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/internal/command/commandargs/shell.go b/internal/command/commandargs/shell.go index 7e2b72e..1fe59fb 100644 --- a/internal/command/commandargs/shell.go +++ b/internal/command/commandargs/shell.go @@ -15,6 +15,8 @@ const ( ReceivePack CommandType = "git-receive-pack" UploadPack CommandType = "git-upload-pack" UploadArchive CommandType = "git-upload-archive" + + GitProtocolEnv = "GIT_PROTOCOL" ) var ( diff --git a/internal/command/receivepack/gitalycall.go b/internal/command/receivepack/gitalycall.go index a8d8160..529b296 100644 --- a/internal/command/receivepack/gitalycall.go +++ b/internal/command/receivepack/gitalycall.go @@ -2,6 +2,7 @@ package receivepack import ( "context" + "os" "google.golang.org/grpc" @@ -26,7 +27,7 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error { GlId: response.UserId, GlRepository: response.Repo, GlUsername: response.Username, - GitProtocol: response.GitProtocol, + GitProtocol: os.Getenv(commandargs.GitProtocolEnv), GitConfigOptions: response.GitConfigOptions, } 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, } |