Skip to main content

relativize_files

Function relativize_files 

Source
pub fn relativize_files(
    files: Vec<DiffInputFile>,
    root: Option<&str>,
) -> Vec<DiffInputFile>
Expand description

Rewrite each record path relative to the report’s root: separators are normalized to / and the root prefix (always with its trailing separator) is stripped. Records whose path does not start with the root are kept verbatim. Paths in the diff output are therefore root-relative and stable across root spellings, which is what makes two scans of the same tree under different roots comparable.