From f498d92ff4686c2b1bfba87b3e44987ef87a66e7 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 3 Feb 2014 12:15:17 -0800 Subject: [PATCH] Ignore missing newline message git diff adds the following line to diffs: \ No newline at end of file which interferes with diff.py parsing. diff.py only looks for '+', '-' and ' ' at the beginning of the line. Issue seen on https://gerrit.chromium.org/gerrit/68611 Change-Id: I0d7b4485c470e0b409f2c9cddde6c9aceba0152e --- tools/diff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/diff.py b/tools/diff.py index a42a4dc..a96c7db 100644 --- a/tools/diff.py +++ b/tools/diff.py @@ -56,6 +56,9 @@ class DiffHunk(object): elif line[0] == " ": self.left.Append(line) self.right.Append(line) + elif line[0] == "\\": + # Ignore newline messages from git diff. + pass else: assert False, ("Unrecognized character at start of diff line " "%r" % line[0]) -- 2.7.4