Commit 7288ed8
git add -i: Fix parsing of abbreviated hunk headers
The unified diff format allows one-line ranges to be abbreviated
by omiting the size. The hunk header "@@ -10,1 +10,1 @@" can be
expressed as "@@ -10 +10 @@", but this wasn't properly parsed in
all cases.
Such abbreviated hunk headers are generated when a one-line change
(add, remove or modify) appears without context; for example
because the file is a one-liner itself or because GIT_DIFF_OPTS
was set to '-u0'. If the user then runs 'git add -i' and enters
the 'patch' command for that file, perl complains about undefined
variables.
Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>1 parent a72c874 commit 7288ed8
1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| |||
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | 710 | | |
712 | 711 | | |
713 | 712 | | |
| |||
719 | 718 | | |
720 | 719 | | |
721 | 720 | | |
722 | | - | |
| 721 | + | |
723 | 722 | | |
724 | 723 | | |
725 | | - | |
| 724 | + | |
726 | 725 | | |
727 | 726 | | |
728 | 727 | | |
| |||
0 commit comments