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

Showing the changes to tools/diff.py (1 of 1 file). Show all

Unified · Split

tools/diff.py+3−0
@@ -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])

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