summaryrefslogtreecommitdiff
path: root/internal/command/receivepack/receivepack.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/command/receivepack/receivepack.go')
-rw-r--r--internal/command/receivepack/receivepack.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/command/receivepack/receivepack.go b/internal/command/receivepack/receivepack.go
index 4d5c686..5a67c5a 100644
--- a/internal/command/receivepack/receivepack.go
+++ b/internal/command/receivepack/receivepack.go
@@ -2,6 +2,7 @@ package receivepack
import (
"context"
+ "os"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
@@ -38,7 +39,14 @@ func (c *Command) Execute(ctx context.Context) error {
return customAction.Execute(ctx, response)
}
- return c.performGitalyCall(response)
+ var gitProtocolVersion string
+ if c.Args.RemoteAddr != nil {
+ gitProtocolVersion = c.Args.GitProtocolVersion
+ } else {
+ gitProtocolVersion = os.Getenv(commandargs.GitProtocolEnv)
+ }
+
+ return c.performGitalyCall(response, gitProtocolVersion)
}
func (c *Command) verifyAccess(ctx context.Context, repo string) (*accessverifier.Response, error) {