fn commit(&self, message: &str) -> Result<()> {
        let repo = &self.0;
        // Find the current tree
        let tree_oid = repo.index()?.write_tree()?;
        let tree = repo.find_tree(tree_oid)?;
        // Find the commit "metadata" (i.e. author, etc)
        let config = repo.config()?;
        let name = config.get_string("user.name")?;
        let email = config.get_string("user.email")?;
        let signature = git2::Signature::now(&name, &email)?;
        // Get the parent commit
        let parent_commit = repo.head()?.resolve()?.peel_to_commit()?;
        // Perform the actual commit
        repo.commit(
            Some(HEAD),
            &signature,
            &signature,
            message,
            &tree,
            &[&parent_commit],
        )?;
        Ok(())
    }
/// Commit the staged paths with the provided message.
Commit the staged paths with the provided message.
Commit the staged paths with the provided message .
fn commit(&self, message: &str) -> Result<()> {
        let repo = &self.0;
        // Find the current tree
        let tree_oid = repo.index()?.write_tree()?;
        let tree = repo.find_tree(tree_oid)?;
        // Find the commit "metadata" (i.e. author, etc)
        let config = repo.config()?;
        let name = config.get_string("user.name")?;
        let email = config.get_string("user.email")?;
        let signature = git2::Signature::now(&name, &email)?;
        // Get the parent commit
        let parent_commit = repo.head()?.resolve()?.peel_to_commit()?;
        // Perform the actual commit
        repo.commit(
            Some(HEAD),
            &signature,
            &signature,
            message,
            &tree,
            &[&parent_commit],
        )?;
        Ok(())
    }
fn commit ( & self , message : & str ) -> Result < ( ) > { let repo = & self . 0 ; // Find the current tree let tree_oid = repo . index ( ) ? . write_tree ( ) ? ; let tree = repo . find_tree ( tree_oid ) ? ; // Find the commit "metadata" (i.e. author, etc) let config = repo . config ( ) ? ; let name = config . get_string ( " " ) ? ; let email = config . get_string ( " " ) ? ; let signature = git2 :: Signature :: now ( & name , & email ) ? ; // Get the parent commit let parent_commit = repo . head ( ) ? . resolve ( ) ? . peel_to_commit ( ) ? ; // Perform the actual commit repo . commit ( Some ( HEAD ) , & signature , & signature , message , & tree , & [ & parent_commit ] , ) ? ; Ok ( ( ) ) }
Commit the staged paths with the provided message.
Commit the staged paths with the provided message .
&self
message
&str
&self
message
&str