Repository navigation
Commit beadcb8
committed
fix(submodule): check transport policy before replacing a remote
`RootModule.update` fetches a temporary remote when `.gitmodules` changes a
submodule URL. That fetch still treated the URL as user-provided, even after
ordinary submodule clone/fetch gained Git's non-user transport environment.
It could therefore access a denied local repository and replace `origin`
before the subsequent ordinary fetch finally rejected the transport.
Port PR #2304's separate changed-URL regression and apply the existing
`_transport_env()` helper to that initial fetch. The test compares denial
with real `git submodule sync` / `update --remote`, and checks unchanged
HEAD and original-remote preservation against a rejected Git fetch. Its
location-dependent initial repositories use the shared scripted fixtures.
Both source regressions failed on the original CLI and Gix backends. The
changed-URL test also failed independently after the ordinary update fix,
because `origin` had already changed. After this fix, 17 focused transport,
root-update, and no-fetch cases pass on each backend under the isolated
runner, using Git 2.54.0 and GixPython 0.2.0. Ruff lint/format, shellcheck,
and `git diff --check` pass. The fetch remains an explicit CLI operation.1 parent 9b4fe22 commit beadcb8
3 files changed
Lines changed: 43 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
168 | 196 | | |
169 | 197 | | |
170 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments