fix: parse header and hunksize strictly before context

The cause of #363 (closed) turns out to be that a diff of a line-based SQL comment (-- at the start-of-line) can emit a triple-minus-symbol within a hunk that is misinterpreted by the side-by-side diff parser as part of a diff header.

The fix here makes the relevant diff parsing logic stricter; headers (--- left filename, +++ right filename) are only matched until we encounter a hunk size indicator (@@), and at that point we switch into a context-parsing loop.

Fixes #363 (closed).

Edited by James Addison

Merge request reports

Loading