]> git.ozlabs.org Git - patchwork/commit
[parser] Handle special case of "New newline at end of file"
authorNate Case <ncase@xes-inc.com>
Mon, 20 Oct 2008 16:31:11 +0000 (11:31 -0500)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 23 Oct 2008 03:27:10 +0000 (14:27 +1100)
commit6cf42625073d11bd63adc681a4d141a932925d0e
tree5a0f1227dff58314680392fdbb3a7a2a4a5f4cfd
parentd45218b2e3894211e11313820bea9f59677c4bf2
[parser] Handle special case of "New newline at end of file"

If a file doesn't have a newline at the end, diff will insert a "\ No
newline at end of file" line in the middle of the last hunk. parser.py
was counting this line as part of the hunk line count. This had the side
effect of putting the last line of the hunk in the patch comment, and
truncating out the last line of the diff.

Handle this special case by not including this line in the internal line
counter. This appears to be the only case where diff will insert a
string like this within a hunk.

Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/parser.py