From 390425bdef450a0eb246552f94ca88a05dc11d06 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 7 Dec 2009 18:22:42 -0600 Subject: [PATCH] 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 Signed-off-by: Shawn O. Pearce --- lib/diff.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/diff.tcl b/lib/diff.tcl index bd5d189ed..066755b86 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -664,6 +664,7 @@ proc apply_line {x y} { } set i_l $next_l } + set patch "$patch$pre_context" set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch" if {[catch { -- 2.30.2