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 #13875

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions workflow/artifacts/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"io"
"os"
"regexp"
"strings"

"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 @@ -85,6 +87,20 @@ 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)
var newCaps []capability.Capability
if strings.Contains(a.Repo, "dev.azure.com") {
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