Whole file

cscorley/whatthepatch

The author described this change as Fix unified diff parse error. It counts as a record because the check below fails on the code as it stood at fd85f9912 and passes on 2d3e50528, with nothing else changed between the two runs.

Fix saved2021-02-04
Sharing licenceMIT · LICENSE
Change size+3 2

What the code was meant to do, written into the code itself as a save note

Fix unified diff parse error

The change

622622 elif kind == "+" and (i != new_len or i == 0):
623623 changes.append(Change(None, new + i, line, hunk_n))
624624 i += 1
625- elif kind == " " and r != old_len and i != new_len:
626- changes.append(Change(old + r, new + i, line, hunk_n))
625+ elif kind == " ":
626+ if r != old_len and i != new_len:
627+ changes.append(Change(old + r, new + i, line, hunk_n))
627628 r += 1
628629 i += 1
629630

The check that tells the two apart

failpass·tests/test_apply.py::ApplyTestSuite::test_diff_context

Check file tests/test_apply.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itfd85f991260f25fdf351689a5dcf163df6ecfb90
Broken version dated2020-11-14
Modulewhatthepatch.patch
Units changedparse_unified_diff
Fingerprint0afe129ea0d6398d
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.