Skip to content

Commit

Permalink
Merge pull request #576 from fluxcd/multi-ack
Browse files Browse the repository at this point in the history
git/gogit: add multi_ack/multi_ack_detailed as a supported capability
  • Loading branch information
aryan9600 authored May 31, 2023
2 parents c0c812b + 973caff commit fe2cbaa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions git/gogit/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/cache"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/go-git/go-git/v5/plumbing/protocol/packp/capability"
"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/go-git/go-git/v5/storage"
"github.com/go-git/go-git/v5/storage/filesystem"
Expand All @@ -42,6 +43,26 @@ import (
"github.com/fluxcd/pkg/git/repository"
)

func init() {
// Git servers that exclusively use the v2 wire protocol, such as Azure
// Devops and AWS CodeCommit require the capabilities multi_ack
// and multi_ack_detailed, which are not fully implemented by go-git.
// Hence, by default they are included in transport.UnsupportedCapabilities.
//
// The initial clone operations require a full download of the repository,
// and therefore those unsupported capabilities are not as crucial, so
// by removing them from that list allows for the first clone to work
// successfully.
//
// Additional fetches will yield issues, therefore work always from a clean
// clone until those capabilities are fully supported.
//
// New commits and pushes against a remote worked without any issues.
transport.UnsupportedCapabilities = []capability.Capability{
capability.ThinPack,
}
}

// ClientName is the string representation of Client.
const ClientName = "go-git"

Expand Down

0 comments on commit fe2cbaa

Please sign in to comment.