Skip to content

Commit

Permalink
[0.12.x] Fix azure devops (#1338)
Browse files Browse the repository at this point in the history
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

Signed-off-by: Tom Kennedy <[email protected]>
  • Loading branch information
tomkennedy513 authored Oct 3, 2023
1 parent bc76956 commit cbe4b20
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 cbe4b20

Please sign in to comment.