From ae2221720ff4e26bcd1140c4fa805116e3edc476 Mon Sep 17 00:00:00 2001 From: Tom Kennedy Date: Mon, 2 Oct 2023 11:11:44 -0400 Subject: [PATCH] Fix cloning with Azure DevOps Git - remove multi_ack and multi_ack_detailed from unsupported capabilities - see https://github.com/go-git/go-git/blob/52c2972976737a00fce91d7deb1278a6a460cae6/_examples/azure_devops/main.go\#L21-L36 for more info - we should be able to remove this once go-git implements full support for v2 git with multi_ack fixes #1336 Signed-off-by: Tom Kennedy --- pkg/git/fetch.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/git/fetch.go b/pkg/git/fetch.go index 999ca6568..8725045d3 100644 --- a/pkg/git/fetch.go +++ b/pkg/git/fetch.go @@ -9,6 +9,7 @@ import ( gogit "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" + "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/pkg/errors" ) @@ -18,6 +19,13 @@ type Fetcher struct { Keychain GitKeychain } +func init() { + //remove multi_ack and multi_ack_detailed from unsupported capabilities to enable Azure DevOps git support + transport.UnsupportedCapabilities = []capability.Capability{ + capability.ThinPack, + } +} + func (f Fetcher) Fetch(dir, gitURL, gitRevision, metadataDir string) error { f.Logger.Printf("Cloning %q @ %q...", gitURL, gitRevision) auth, err := f.Keychain.Resolve(gitURL)