pub fn commit(repo_path: &str, msg: &str) -> Result<CommitId> {
    scope_time!("commit");

    let repo = repo(repo_path)?;

    let signature = signature_allow_undefined_name(&repo)?;
    let mut index = repo.index()?;
    let tree_id = index.write_tree()?;
    let tree = repo.find_tree(tree_id)?;

    let parents = if let Ok(id) = get_head(repo_path) {
        vec![repo.find_commit(id.into())?]
    } else {
        Vec::new()
    };

    let parents = parents.iter().collect::<Vec<_>>();

    Ok(repo
        .commit(
            Some("HEAD"),
            &signature,
            &signature,
            msg,
            &tree,
            parents.as_slice(),
        )?
        .into())
}
/// this does not run any git hooks
this does not run any git hooks
this does not run any git hooks
pub fn commit(repo_path: &str, msg: &str) -> Result<CommitId> {
    scope_time!("commit");
    let repo = repo(repo_path)?;
    let signature = signature_allow_undefined_name(&repo)?;
    let mut index = repo.index()?;
    let tree_id = index.write_tree()?;
    let tree = repo.find_tree(tree_id)?;
    let parents = if let Ok(id) = get_head(repo_path) {
        vec![repo.find_commit(id.into())?]
    } else {
        Vec::new()
    };
    let parents = parents.iter().collect::<Vec<_>>();
    Ok(repo
        .commit(
            Some("HEAD"),
            &signature,
            &signature,
            msg,
            &tree,
            parents.as_slice(),
        )?
        .into())
}
pub fn commit ( repo_path : & str , msg : & str ) -> Result < CommitId > { scope_time ! ( " " ) ; let repo = repo ( repo_path ) ? ; let signature = signature_allow_undefined_name ( & repo ) ? ; let mut index = repo . index ( ) ? ; let tree_id = index . write_tree ( ) ? ; let tree = repo . find_tree ( tree_id ) ? ; let parents = if let Ok ( id ) = get_head ( repo_path ) { vec ! [ repo find_commit ( id into ( ) ) ] } else { Vec :: new ( ) } ; let parents = parents . iter ( ) . collect :: < Vec < _ > > ( ) ; Ok ( repo . commit ( Some ( " " ) , & signature , & signature , msg , & tree , parents . as_slice ( ) , ) ? . into ( ) ) }
this does not run any git hooks
this does not run any git hooks
repo_path
&str
msg
&str