Fix parsing unified diff hunks with "No newline at end of file" markers.

Review Request #12578 — Created Sept. 4, 2022 and submitted — Latest diff uploaded

chipx86
DiffX
master
diffx

When parsing unified diff hunks, a "No newline at end of file" marker
found within content would be seen as garbage, causing a
MalformedHunkError to be raised. This could easily manifest when
generating stats for metadata sections.

The parser now handles these lines within a hunk. They're counted as
processed, but are otherwise ignored.

Unit tests pass.

Tested this with some repro cases we were sent. All parsing passed.

Commits

Files

Loading...