gitcc_git/
index.rs

1//! Index
2
3use git2::IndexAddOption;
4
5use crate::{Error, GitRepository};
6
7/// Runs `git add --all`
8pub fn add_all(repo: &GitRepository) -> Result<(), Error> {
9    let mut index = repo.index()?;
10    index.add_all(["*"].iter(), IndexAddOption::DEFAULT, None)?;
11    index.write()?;
12    Ok(())
13}