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 <jepler@unpythonic.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Jeff Epler committed
Dec 7, 2009 at 18:22 UTC
390425bdef450a0eb246552f94ca88a05dc11d06
1 file changed
+1
lib/diff.tcl
+1
@@ -664,6 +664,7 @@ proc apply_line {x y} {
664
}
665
set i_l $next_l
666
}
667
+ set patch "$patch$pre_context"
668
set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch"
669
670
if {[catch {