Skip to content

Commit

Permalink
fix: Fixes git over azure devops Fixes #11705
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Lütke Stetzkamp <cls@tessitura.io>
  • Loading branch information
Christian Lütke Stetzkamp committed Mar 25, 2024
1 parent 66680f1 commit ba1fdaa
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit ba1fdaa

Please sign in to comment.