]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/parser.py
[parser] Handle special case of "New newline at end of file"
[patchwork] / apps / patchwork / parser.py
index abec782f4f7c75cf74d7a83ef73b07f680addbdd..16cc30851e6cc8f38e34cb0e66491cdd84bf347c 100644 (file)
@@ -133,6 +133,9 @@ def parse_patch(text):
                 lc[0] -= 1
             elif line.startswith('+'):
                 lc[1] -= 1
+            elif line.startswith('\ No newline at end of file'):
+                # Special case: Not included as part of the hunk's line count
+                pass
             else:
                 lc[0] -= 1
                 lc[1] -= 1