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.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/command/receivepack/receivepack.go b/internal/command/receivepack/receivepack.go
index 976ab39..c9ef7cd 100644
--- a/internal/command/receivepack/receivepack.go
+++ b/internal/command/receivepack/receivepack.go
@@ -4,6 +4,7 @@ import (
"context"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/commandargs"
+ "gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/githttp"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/shared/accessverifier"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/shared/customaction"
@@ -30,6 +31,20 @@ func (c *Command) Execute(ctx context.Context) error {
}
if response.IsCustomAction() {
+ // When `geo_proxy_direct_to_primary` feature flag is enabled, a Git over HTTP direct request
+ // to primary repo is performed instead of proxying the request through Gitlab Rails.
+ // After the feature flag is enabled by default and removed,
+ // custom action functionality will be removed along with it.
+ if response.Payload.Data.GeoProxyDirectToPrimary {
+ cmd := githttp.PushCommand{
+ Config: c.Config,
+ ReadWriter: c.ReadWriter,
+ Response: response,
+ }
+
+ return cmd.Execute(ctx)
+ }
+
customAction := customaction.Command{
Config: c.Config,
ReadWriter: c.ReadWriter,