Commit ffd601c
fix(remote): reject option-shaped update targets
`Remote.update()` also crosses an internal Git command boundary: Git's
`remote update` parses options, then forwards the remaining operands to
`fetch --multiple` without an option terminator. A leading-dash remote
name can therefore change the requested operation or its target set.
Reject such names before dispatch. Document at `_call_process()` why
high-level wrappers must protect operands, while the low-level runner
must continue supporting deliberately positional options. Shell quoting
does not affect Git's own option parsing. Add an unreleased changelog entry.
Git reference: `builtin/remote.c:update()` at Git commit
`12cb6293d6288865c1a133cf22accbaf99d13eb6` constructs the internal fetch
command without preserving `--`.
Validation: three new rejection cases failed before the fix. Positional,
remote, and command tests pass 160 cases with one skip, excluding the
previously reproduced baseline fetch failure in `TestRemote.test_base`.
Ruff 0.16.5 lint and formatting checks pass for all eight changed Python
files, and `git diff --check` passes.1 parent 65ed3f8 commit ffd601c
4 files changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1795 | 1795 | | |
1796 | 1796 | | |
1797 | 1797 | | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
1798 | 1804 | | |
1799 | 1805 | | |
1800 | 1806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
874 | 877 | | |
875 | 878 | | |
876 | 879 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
0 commit comments