Commit 2ac481c
committed
fix(git): system-git fallback for Azure DevOps repositories (#288)
go-git v5 strips MultiACK/MultiACKDetailed from its capability
advertisement. ADO rejects any upload-pack request that omits
multi_ack with HTTP 400 (TF401041: "Clients must support multi-ack.").
This change adds a per-URL system-git fallback: any remote whose URL
contains dev.azure.com, visualstudio.com, or ssh.dev.azure.com is
routed through exec.Command("git", ...) instead of go-git. All other
providers continue to use the existing go-git path unchanged.
Three entry points now delegate to system git for ADO URLs:
- SmartFetch → systemGitSmartFetch (git ls-remote + git fetch)
- PushAtomic → systemGitPushAtomic (git ls-remote + git push --force-with-lease)
- CheckRepo → systemGitCheckRepo (git ls-remote --symref)
Credentials are never passed via argv:
- BasicAuth: GIT_CONFIG_GLOBAL with http.extraHeader = Authorization: Basic <base64>
- TokenAuth: GIT_CONFIG_GLOBAL with http.extraHeader = Authorization: Bearer <token>
- SSH: GIT_SSH_COMMAND with -i <keyfile> and optional known_hosts
Dockerfile: adds a git-bundle Alpine stage that collects git and all
its musl shared-library dependencies via ldd, then copies them into
the distroless final image. The distroless/static:debug base already
includes /bin/sh (busybox), which is required to execute the
GIT_ASKPASS script.
Proper fix: go-git PR #1204 (full multi_ack implementation) is targeted
for v6.0.0, which is still in alpha as of 2026-07-28. Drop this
fallback and upgrade to go-git v6 once a stable release lands.1 parent aed4af9 commit 2ac481c
9 files changed
Lines changed: 907 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
52 | 79 | | |
53 | 80 | | |
54 | 81 | | |
| |||
69 | 96 | | |
70 | 97 | | |
71 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
72 | 108 | | |
73 | 109 | | |
74 | 110 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
95 | 118 | | |
96 | 119 | | |
97 | 120 | | |
| |||
0 commit comments