Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixes git over azure devops Fixes #11705 #12598

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions workflow/artifacts/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"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/go-git/go-git/v5/plumbing/transport/http"
ssh2 "github.com/go-git/go-git/v5/plumbing/transport/ssh"
Expand Down Expand Up @@ -84,6 +85,19 @@ func (g *ArtifactDriver) Delete(s *wfv1.Artifact) error {

func (g *ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error {
a := inputArtifact.Git

// Azure DevOps requires multi_ack* capabilities which go-git does not currently support
// Workaround: removing these from UnsupportedCapabilities allows clones to work (see https://github.com/go-git/go-git/pull/613)
// TODO: remove this once https://github.com/go-git/go-git/issues/64 is fully fixed
var newCaps []capability.Capability
for _, c := range transport.UnsupportedCapabilities {
if c == capability.MultiACK || c == capability.MultiACKDetailed {
continue
}
newCaps = append(newCaps, c)
}
transport.UnsupportedCapabilities = newCaps

sshUser := GetUser(a.Repo)
closer, auth, err := g.auth(sshUser)
if err != nil {
Expand Down
Loading