From: Jeff Epler Date: Tue, 8 Dec 2009 00:22:42 +0000 (-0600) Subject: git-gui: Fix applying a line when all following lines are deletions X-Git-Tag: v1.7.0-rc0~3^2^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=390425bdef450a0eb246552f94ca88a05dc11d06;p=git.git 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 --- 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 {