Repository navigation
Commit db24842
committed
fix(diff): request a/ and b/ header prefixes for patch diffs
With diff.noprefix, diff.srcPrefix or diff.dstPrefix set, git diff emits a
patch header without the a/ and b/ prefixes, which Diff.re_header and
decode_path both require. The result is an empty DiffIndex, with no error,
for index and worktree changes; the diff-tree path is unaffected, so the
two documented shapes disagree.
The same function already injects -c diff.mnemonicPrefix=false four lines
below, because that key rewrites the prefixes the same way. Rather than
adding three more config overrides, request the prefixes on the command
line, which takes precedence over all four keys and needs no change to
the _config allowlist in git/cmd.py.1 parent 1c9ef7d commit db24842
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
284 | 290 | | |
285 | 291 | | |
286 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
0 commit comments