jepler committed 390425b

git-gui: Fix applying a line when all following lines are deletions

If a diff looked like:


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 <>
Signed-off-by: Shawn O. Pearce <>

  • Participants
  • Parent commits 7ec2b69

Comments (0)

Files changed (1)

File lib/diff.tcl

 		set i_l $next_l
+	set patch "$patch$pre_context"
 	set patch "@@ -$hln,$n +$hln,[eval expr $n $sign 1] @@\n$patch"
 	if {[catch {