diff_file_contents

Function diff_file_contents 

Source
pub fn diff_file_contents(
    previous: &HashMap<String, String>,
    current: &HashMap<String, String>,
    skip_unchanged: bool,
    explicit_context: Option<usize>,
) -> Vec<PerFileDiff>
Expand description

Diff per file content sets.

Inputs are maps keyed by file path (relative or absolute – caller decides) with values being the raw file content EXACTLY as you wish it to be diffed (e.g. already stripped of volatile metadata, no size/modified lines, only the real file body). This keeps higher level logic (parsing the markdown document) out of the diff layer.

Returns a vector of PerFileDiff for every file that is Added, Removed, or Modified. Unchanged files are omitted by default (skip_unchanged=true) to reduce noise, but you can opt to include them.