Skip to main content

get_changed_lines_from_git

Function get_changed_lines_from_git 

Source
pub fn get_changed_lines_from_git(
    project_root: &PathBuf,
    base_ref: &str,
) -> Result<ChangedLines>
Expand description

Get changed lines by running git diff against a base reference

This runs git diff --unified=0 to get a minimal diff showing only the exact lines that changed.

§Arguments

  • project_root - The root directory of the git repository
  • base_ref - The git reference to compare against (e.g., “origin/main”)

§Returns

A map of file paths to the set of changed line numbers