diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2020-11-21 15:46:40 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2020-11-21 15:46:40 +0300 |
commit | c72363bf28280a0b72ab01348576c67b92b31e2b (patch) | |
tree | b1ecb46e4785d89f6e21e8a50970bdfac30ad359 | |
parent | 20dd176020c9b2d1e3b310020cccf84c78b676f3 (diff) |
Quoting bug workaround
-rw-r--r-- | cmd/gitaly-hooks/hooks.go | 8 | ||||
-rw-r--r-- | internal/gitaly/service/smarthttp/upload_pack_test.go | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cmd/gitaly-hooks/hooks.go b/cmd/gitaly-hooks/hooks.go index 956ad0032..c078b59b4 100644 --- a/cmd/gitaly-hooks/hooks.go +++ b/cmd/gitaly-hooks/hooks.go @@ -228,6 +228,12 @@ func main() { logger.Fatalf("error when receiving data for %q: %v", subCmd, err) } case "git": + args := os.Args[2:] + // Silly workaround for Git quoting bug: --filter='limit=200' should not contain single quotes. + for i, a := range args { + args[i] = strings.Replace(a, "'", "", -1) + } + packObjectsHookStream, err := hookClient.PackObjectsHook(ctx) if err != nil { hello.Fatalf("error when getting stream client for %q: %v", subCmd, err) @@ -235,7 +241,7 @@ func main() { if err := packObjectsHookStream.Send(&gitalypb.PackObjectsHookRequest{ Repository: repository, - Args: os.Args[2:], + Args: args, }); err != nil { hello.Fatalf("error when sending request for %q: %v", subCmd, err) } diff --git a/internal/gitaly/service/smarthttp/upload_pack_test.go b/internal/gitaly/service/smarthttp/upload_pack_test.go index caebc6ef9..ebbc6d341 100644 --- a/internal/gitaly/service/smarthttp/upload_pack_test.go +++ b/internal/gitaly/service/smarthttp/upload_pack_test.go @@ -324,8 +324,6 @@ func extractPackDataFromResponse(t *testing.T, buf *bytes.Buffer) ([]byte, int, } func TestUploadPackRequestForPartialCloneSuccess(t *testing.T) { - t.Skip("skipping because of quoting issue in pack-objects hook") - negotiationMetrics := prometheus.NewCounterVec(prometheus.CounterOpts{}, []string{"feature"}) serverSocketPath, stop := runSmartHTTPServer( |