Commit 0d8d845
fix(index): preserve path operands when moving and checking ignores
<!-- agent -->
`IndexFile.move()` forwarded paths without an option separator in both
its preliminary dry run and its actual move. A `--force` operand could
overwrite an existing destination, and `--no-dry-run` could move files
even when the caller explicitly requested `dry_run=True`.
`Repo.ignored()` likewise interpreted leading-dash filenames as options.
Insert `--` before paths in both wrappers. The shared move argument list
protects both invocations; explicit keyword options still work. Literal
leading-dash filenames, including values containing spaces, remain usable.
Update the unreleased changelog for both APIs.
Git reference: `builtin/mv.c` and `builtin/check-ignore.c` use
`parse_options()` with `--` support at Git commit
`12cb6293d6288865c1a133cf22accbaf99d13eb6`.
Validation: all four new path regressions failed before the fix. The
positional, index, and repository suites pass 153 tests and 14 subtests,
with four skips, using test-local `init.defaultBranch=master` and
`core.quotePath=true`. One unrelated revision-parsing test was excluded:
it traverses pre-existing checkpoint refs pointing at trees. Tested with
Apple Git 2.54.0; `git diff --check` passes.
Assisted-by: GPT 6.0
Co-authored-by: GPT 6.0 <codex@openai.com>1 parent 03b5db2 commit 0d8d845
3 files changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
| 1136 | + | |
1136 | 1137 | | |
1137 | 1138 | | |
1138 | 1139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | | - | |
| 1140 | + | |
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
0 commit comments