Skip to main content

get_worktree_file_diff

Function get_worktree_file_diff 

Source
pub fn get_worktree_file_diff(
    repo_path: &Path,
    file_path: &str,
    staged: bool,
) -> Vec<DiffLine>
Expand description

Return the diff for file_path in the working tree.

  • staged = true: diff between HEAD and the index (what would be committed).
  • staged = false: diff between the index and the working directory (unstaged changes).

Returns an empty Vec on any error.