run_git_diff_index

Function run_git_diff_index 

Source
fn run_git_diff_index<F, T>(git_dir: Option<&Path>, func: F) -> T
where F: FnOnce(&mut Command) -> T,
Expand description

diff-index can return outdated information, because it does not update the git index. This function uses update-index to update the index first, and then provides func with a command prepared to run git diff-index.