Skip to content

Commit

Permalink
Fix cloning with Azure DevOps Git
Browse files Browse the repository at this point in the history
- 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

Signed-off-by: Tom Kennedy <[email protected]>
  • Loading branch information
tomkennedy513 committed Oct 2, 2023
1 parent 2a98bed commit 2a2a526
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/git/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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)
Expand Down

0 comments on commit 2a2a526

Please sign in to comment.