summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLibravatar Jeff Epler <jepler@unpythonic.net>2009-12-07 18:22:42 -0600
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2010-01-23 15:00:09 -0800
commit390425bdef450a0eb246552f94ca88a05dc11d06 (patch)
tree3a277ad02d60707d4588980c113e3c67a19128d2 /lib
parentgit-gui: Correct file_states when unstaging partly staged entry (diff)
downloadtgif-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>
Diffstat (limited to 'lib')
-rw-r--r--lib/diff.tcl1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/diff.tcl b/lib/diff.tcl
index bd5d189ed1..066755b864 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 {