History

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

Johann committed 12 years ago

Commit f498d921 parent 37e53251 file · +3 −0Browse files

Unified · Split

tools/diff.py+3−0
@@ -56,6 +56,9 @@ class DiffHunk(object): · 55 unmodified lines
5656 elif line[0] == " ":
5757 self.left.Append(line)
5858 self.right.Append(line)
59+ elif line[0] == "\\":
60+ # Ignore newline messages from git diff.
61+ pass
5962 else:
6063 assert False, ("Unrecognized character at start of diff line "
6164 "%r" % line[0])

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t