Function get_diff

Source
pub fn get_diff(repo: &Repository) -> Result<Diff<'_>>
Expand description

Fetch the git2::Diff about a given git2::Repository.

This is actually not used in CI for file permissions and ownership reasons. Rather this is only (supposed to be) used when executed on a local developer machine.

If there are files staged for a commit, then the resulting Diff will describe the staged changes. However, if there are no staged changes, then the last commit’s Diff is returned.