1
2
3
4
5
6
7
8
9
10
11
12
13
//! Index

use git2::IndexAddOption;

use crate::{Error, GitRepository};

/// Runs `git add --all`
pub fn add_all(repo: &GitRepository) -> Result<(), Error> {
    let mut index = repo.index()?;
    index.add_all(["*"].iter(), IndexAddOption::DEFAULT, None)?;
    index.write()?;
    Ok(())
}