Skip to main content

base_coverage_inputs

Function base_coverage_inputs 

Source
pub fn base_coverage_inputs(
    root: &Path,
    coverage: Option<&Path>,
    coverage_root: Option<&Path>,
) -> BaseCoverageInputs
Expand description

Coverage inputs for the base-worktree pass.

The Istanbul map records head-checkout paths, while the base pass analyzes a temporary worktree. Without a rebase no coverage entry matches a base file, base CRAP falls back to the reachability estimate, and unchanged functions flip to introduced (#2347). Without an explicit map, the head pass auto-detects coverage/coverage-final.json against the head root, which the base worktree never has, so the same detection runs here. When no explicit coverage_root exists, the canonical head root becomes the strip prefix, so every entry rebases onto the base worktree. An explicit coverage_root stays as it is: the base pass rebases it onto its own root.