Skip to content

Commit

Permalink
Signed-off-by: tooptoop4 <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
tooptoop4 authored Nov 6, 2024
1 parent 4742e9d commit 8e18552
Showing 1 changed file with 16 additions and 0 deletions.
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 a.Repo && strings.Contains(a.Repo, "dev.azure.com") {

Check failure on line 94 in workflow/artifacts/git/git.go

View workflow job for this annotation

GitHub Actions / Lint

invalid operation: a.Repo && strings.Contains(a.Repo, "dev.azure.com") (mismatched types string and bool)) (typecheck)

Check failure on line 94 in workflow/artifacts/git/git.go

View workflow job for this annotation

GitHub Actions / Lint

invalid operation: a.Repo && strings.Contains(a.Repo, "dev.azure.com") (mismatched types string and bool) (typecheck)

Check failure on line 94 in workflow/artifacts/git/git.go

View workflow job for this annotation

GitHub Actions / Unit Tests

invalid operation: a.Repo && strings.Contains(a.Repo, "dev.azure.com") (mismatched types string and bool)
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 8e18552

Please sign in to comment.