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
Showing the changes to tools/diff.py (1 of 1 file). Show all
Unified · Split
| @@ -56,6 +56,9 @@ class DiffHunk(object): · 55 unmodified lines | |||
| 56 | elif line[0] == " ": | 56 | elif line[0] == " ": |
| 57 | self.left.Append(line) | 57 | self.left.Append(line) |
| 58 | self.right.Append(line) | 58 | self.right.Append(line) |
| 59 | elif line[0] == "\\": | ||
| 60 | # Ignore newline messages from git diff. | ||
| 61 | pass | ||
| 59 | else: | 62 | else: |
| 60 | assert False, ("Unrecognized character at start of diff line " | 63 | assert False, ("Unrecognized character at start of diff line " |
| 61 | "%r" % line[0]) | 64 | "%r" % line[0]) |