fn perform_commit_and_push(&self, msg: &str, modified_file: &Path) -> anyhow::Result<()> {
        // git add $file
        let mut index = self.repository.index()?;
        index.add_path(modified_file)?;
        index.write()?;
        let tree_id = index.write_tree()?;
        let tree = self.repository.find_tree(tree_id)?;

        // git commit -m "..."
        let head = self.head_oid()?;
        let parent = self.repository.find_commit(head)?;
        let sig = self.repository.signature()?;
        self.repository
            .commit(Some("HEAD"), &sig, &sig, msg, &tree, &[&parent])?;

        self.push("refs/heads/master")
    }
/// Commits the specified file with the specified commit message and pushes
/// the commit to the `master` branch on the `origin` remote.
///
/// Note that `modified_file` expects a file path **relative** to the
/// repository working folder!
Commits the specified file with the specified commit message and pushes
the commit to the `master` branch on the `origin` remote.

Note that `modified_file` expects a file path **relative** to the
repository working folder!
Commits the specified file with the specified commit message and pushes the commit to the ` master ` branch on the ` origin ` remote . Note that ` modified_file ` expects a file path ** relative ** to the repository working folder!
fn perform_commit_and_push(&self, msg: &str, modified_file: &Path) -> anyhow::Result<()> {
        // git add $file
        let mut index = self.repository.index()?;
        index.add_path(modified_file)?;
        index.write()?;
        let tree_id = index.write_tree()?;
        let tree = self.repository.find_tree(tree_id)?;
        // git commit -m "..."
        let head = self.head_oid()?;
        let parent = self.repository.find_commit(head)?;
        let sig = self.repository.signature()?;
        self.repository
            .commit(Some("HEAD"), &sig, &sig, msg, &tree, &[&parent])?;
        self.push("refs/heads/master")
    }
fn perform_commit_and_push ( & self , msg : & str , modified_file : & Path ) -> anyhow :: Result < ( ) > { // git add $file let mut index = self . repository . index ( ) ? ; index . add_path ( modified_file ) ? ; index . write ( ) ? ; let tree_id = index . write_tree ( ) ? ; let tree = self . repository . find_tree ( tree_id ) ? ; // git commit -m "..." let head = self . head_oid ( ) ? ; let parent = self . repository . find_commit ( head ) ? ; let sig = self . repository . signature ( ) ? ; self . repository . commit ( Some ( " " ) , & sig , & sig , msg , & tree , & [ & parent ] ) ? ; self . push ( " " ) }
Commits the specified file with the specified commit message and pushes
the commit to the `master` branch on the `origin` remote.
Commits the specified file with the specified commit message and pushes the commit to the ` master ` branch on the ` origin ` remote .
&self
msg
&str
modified_file
&Path