Expand description
Unified-diff model built from git2.
DiffModel captures exactly what coverage attribution needs from a diff:
per file, the set of added (new-side) line numbers, and a deterministic
base↔head alignment for unchanged lines so coverage can be compared across
versions without heuristics. Added lines come from the + lines of the diff;
the alignment is derived from hunk offsets (@@ -a,b +c,d @@) plus the exact
context-line pairs git2 reports inside each hunk.
Rename detection is enabled so a moved file is diffed against its original content — added lines and “lost coverage” are attributed correctly instead of the whole file looking new.
Structs§
- Diff
Model - A whole diff: the set of changed files between two revisions.
- File
Diff - Per-file diff information.
Functions§
- default_
base_ ref - Resolves the default base ref: the merge-base of
origin/main(falling back tomain) andHEAD, returned as a hex SHA.