@@ -54,28 +54,40 @@ func CloneRepo(ctx context.Context, logf func(string, ...any), opts CloneRepoOpt
54
54
return false , fmt .Errorf ("parse url %q: %w" , opts .RepoURL , err )
55
55
}
56
56
logf ("Parsed Git URL as %q" , parsed .Redacted ())
57
- if parsed .Hostname () == "dev.azure.com" || opts .ThinPack {
58
- // Azure DevOps requires capabilities multi_ack / multi_ack_detailed,
59
- // which are not fully implemented and by default are included in
60
- // transport.UnsupportedCapabilities.
61
- //
62
- // The initial clone operations require a full download of the repository,
63
- // and therefore those unsupported capabilities are not as crucial, so
64
- // by removing them from that list allows for the first clone to work
65
- // successfully.
66
- //
67
- // Additional fetches will yield issues, therefore work always from a clean
68
- // clone until those capabilities are fully supported.
69
- //
70
- // New commits and pushes against a remote worked without any issues.
71
- // See: https://github.com/go-git/go-git/issues/64
72
- //
73
- // This is knowingly not safe to call in parallel, but it seemed
74
- // like the least-janky place to add a super janky hack.
57
+
58
+ thinPack := true
59
+
60
+ if ! opts .ThinPack {
61
+ thinPack = false
62
+ logf ("ThinPack options is false, Marking thin-pack as unsupported" )
63
+ } else {
64
+ if parsed .Hostname () == "dev.azure.com" {
65
+ // Azure DevOps requires capabilities multi_ack / multi_ack_detailed,
66
+ // which are not fully implemented and by default are included in
67
+ // transport.UnsupportedCapabilities.
68
+ //
69
+ // The initial clone operations require a full download of the repository,
70
+ // and therefore those unsupported capabilities are not as crucial, so
71
+ // by removing them from that list allows for the first clone to work
72
+ // successfully.
73
+ //
74
+ // Additional fetches will yield issues, therefore work always from a clean
75
+ // clone until those capabilities are fully supported.
76
+ //
77
+ // New commits and pushes against a remote worked without any issues.
78
+ // See: https://github.com/go-git/go-git/issues/64
79
+ //
80
+ // This is knowingly not safe to call in parallel, but it seemed
81
+ // like the least-janky place to add a super janky hack.
82
+ thinPack = false
83
+ logf ("Workaround for Azure DevOps: marking thin-pack as unsupported" )
84
+ }
85
+ }
86
+
87
+ if ! thinPack {
75
88
transport .UnsupportedCapabilities = []capability.Capability {
76
89
capability .ThinPack ,
77
90
}
78
- logf ("Workaround for Azure DevOps: marking thin-pack as unsupported" )
79
91
}
80
92
81
93
err = opts .Storage .MkdirAll (opts .Path , 0o755 )
0 commit comments