Skip to main content

parse_diff_output

Function parse_diff_output 

Source
fn parse_diff_output(text: &str) -> Vec<ChangedFile>
Expand description

Parse the output of git diff-tree -p into per-file ChangedFile entries.

Each file section starts with a diff --git a/<path> b/<path> line. Status is inferred from subsequent mode/rename headers. Diff line kinds are determined by their leading character, with header lines (--- , +++ ) distinguished from content lines (-, +) by the mandatory space that follows the three-character marker.