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

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

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.

Summary
Fix parsing unified diff hunks with "No newline at end of file" markers.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.x (ab3cab4)
Loading...