Skip to content

Commit

Permalink
git-gui: Fix applying a line when all following lines are deletions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Epler authored and Shawn O. Pearce committed Jan 23, 2010
1 parent 7ec2b69 commit 390425b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/diff.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 390425b

Please sign in to comment.