pub fn changed_lines(
repo: &Path,
base: &str,
) -> Result<BTreeMap<String, BTreeSet<u64>>>Expand description
The new-side lines each file gained in repo’s <base>...HEAD diff, keyed by
repo-relative path. The diff machinery shared by the TS / Rust twins.
<base>...HEAD is the merge-base diff — the changes this branch introduced
(what a PR shows). --unified=0 drops context lines so every + line is a
real addition; --no-renames keeps a rename a delete + an add (the added side
is held to coverage); --relative reports paths relative to repo. Returns an
error if git diff fails (e.g. base names no resolvable ref).
The invocation is pinned against the caller’s git config (#392):
-c core.quotepath=off emits non-ASCII bytes raw instead of octal-escaping them,
--no-ext-diff blocks a configured external differ, and forcing
--src-prefix=a/ --dst-prefix=b/ keeps the b/ strip in [new_side_path] working
under a custom diff.mnemonicPrefix / diff.noprefix. Any residual C-quoted path
(a name with a ", a backslash, or a control byte) is decoded in [new_side_path].