Function git_status_vars::count_changes
source · pub fn count_changes(repository: &Repository) -> Result<ChangeCounters, Error>
Expand description
Count changes in the working tree and index (staged area) of a repository.
Examples found in repository?
src/lib.rs (line 154)
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
pub fn summarize_opened_repository<W: std::io::Write>(
out: &ShellWriter<W>,
repository: Repository,
) -> Result<(), git2::Error> {
out.write_var_debug("repo_state", repository.state());
out.write_var(
"repo_workdir",
display_option(repository.workdir().map(|path| path.display())),
);
out.write_var("repo_empty", repository.is_empty()?);
out.write_var("repo_bare", repository.is_bare());
out.group("head").write_vars(&head_info(&repository)?);
out.write_vars(&count_changes(&repository)?);
Ok(())
}