Expand description
Minimal unified-diff parser.
Intentionally hand-rolled to keep dependency surface tiny. Handles
the subset of unified-diff output produced by git diff and diff -u
that the detectors need:
diff --git a/... b/...or--- a/... / +++ b/...file headers@@ -old_start,old_count +new_start,new_count @@hunk headers+/-/body lines
It is not a general patch applier. Line numbers on changed lines are tracked relative to the new file for high-precision reporting.
Structs§
- Added
Line - An added line with its line number in the new file.
- Changed
Hunk - A single changed hunk within a file.
- Diff
- A parsed unified diff.
Enums§
- Diff
Error - Errors returned by
parse_unified_diff.
Functions§
- parse_
unified_ diff - Parse a unified diff into a
Diff.