@@ -10,6 +10,7 @@ import (
10
10
"github.com/go-git/go-git/v5"
11
11
"github.com/go-git/go-git/v5/plumbing"
12
12
"github.com/go-git/go-git/v5/plumbing/cache"
13
+ "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability"
13
14
"github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband"
14
15
"github.com/go-git/go-git/v5/plumbing/transport"
15
16
"github.com/go-git/go-git/v5/storage/filesystem"
@@ -39,6 +40,29 @@ func CloneRepo(ctx context.Context, opts CloneRepoOptions) (bool, error) {
39
40
if err != nil {
40
41
return false , fmt .Errorf ("parse url %q: %w" , opts .RepoURL , err )
41
42
}
43
+ if parsed .Hostname () == "dev.azure.com" {
44
+ // Azure DevOps requires capabilities multi_ack / multi_ack_detailed,
45
+ // which are not fully implemented and by default are included in
46
+ // transport.UnsupportedCapabilities.
47
+ //
48
+ // The initial clone operations require a full download of the repository,
49
+ // and therefore those unsupported capabilities are not as crucial, so
50
+ // by removing them from that list allows for the first clone to work
51
+ // successfully.
52
+ //
53
+ // Additional fetches will yield issues, therefore work always from a clean
54
+ // clone until those capabilities are fully supported.
55
+ //
56
+ // New commits and pushes against a remote worked without any issues.
57
+ // See: https://github.com/go-git/go-git/issues/64
58
+ //
59
+ // This is knowingly not safe to call in parallel, but it seemed
60
+ // like the least-janky place to add a super janky hack.
61
+ transport .UnsupportedCapabilities = []capability.Capability {
62
+ capability .ThinPack ,
63
+ }
64
+ }
65
+
42
66
err = opts .Storage .MkdirAll (opts .Path , 0755 )
43
67
if err != nil {
44
68
return false , fmt .Errorf ("mkdir %q: %w" , opts .Path , err )
0 commit comments