Skip to content

Commit 390425b

Browse files
jeplerspearce
authored andcommitted
git-gui: Fix applying a line when all following lines are deletions
If a diff looked like: @@ context -del1 -del2 and you wanted to stage the deletion 'del1', the generated patch wouldn't apply because it was missing the line 'del2' converted to context, but this line was counted in the @@-line Signed-off-by: Jeff Epler <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 7ec2b69 commit 390425b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/diff.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ proc apply_line {x y} {
664664
}
665665
set i_l $next_l
666666
}
667+
set patch "$patch$pre_context"
667668
set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch"
668669

669670
if {[catch {

0 commit comments

Comments
 (0)