Skip to content

Commit

Permalink
Add transport workaround to git_util if azure dev ops is used
Browse files Browse the repository at this point in the history
More info in go-git/go-git#613 .
  • Loading branch information
stuggi committed Aug 4, 2023
1 parent 906f3e9 commit d444ab0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/openstackconfigversion/git_util.go
Expand Up @@ -30,6 +30,7 @@ import (
git "github.com/go-git/go-git/v5"
config "github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing/format/diff"
"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/ssh"
"github.com/go-git/go-git/v5/storage/memory"
Expand Down Expand Up @@ -141,6 +142,14 @@ func SyncGit(
return nil, err
}

// azure is not compatible to go-git, https://github.com/go-git/go-git/pull/613
// if host contains azure lets set capability.ThinPack
if strings.Contains(strings.ToLower(gitEndpoint.Host), "azure") {
transport.UnsupportedCapabilities = []capability.Capability{
capability.ThinPack,
}
}

publicKeys, err := ssh.NewPublicKeys(gitEndpoint.User, pkey, "")
publicKeys.HostKeyCallback = crypto_ssh.InsecureIgnoreHostKey()
if err != nil {
Expand Down

0 comments on commit d444ab0

Please sign in to comment.