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>
This commit is contained in:
Jeff Epler 2009-12-07 18:22:42 -06:00 committed by Shawn O. Pearce
parent 7ec2b69f1a
commit 390425bdef

View File

@ -664,6 +664,7 @@ proc apply_line {x y} {
} }
set i_l $next_l set i_l $next_l
} }
set patch "$patch$pre_context"
set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch" set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch"
if {[catch { if {[catch {