aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@unpythonic.net>2009-12-07 18:22:42 -0600
committerShawn O. Pearce <spearce@spearce.org>2010-01-23 15:00:09 -0800
commit390425bdef450a0eb246552f94ca88a05dc11d06 (patch)
tree3a277ad02d60707d4588980c113e3c67a19128d2
parent7ec2b69f1ad54db0acee165701c769de33f5ba13 (diff)
downloadgit-390425bdef450a0eb246552f94ca88a05dc11d06.tar.gz
git-390425bdef450a0eb246552f94ca88a05dc11d06.tar.xz
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>
-rw-r--r--lib/diff.tcl1
1 files changed, 1 insertions, 0 deletions
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 {