Skip to main content

commit_snapshot_tree

Function commit_snapshot_tree 

Source
pub fn commit_snapshot_tree(
    message: &str,
    tree: &str,
    dir: &str,
    sign: bool,
    signoff: bool,
    amend: bool,
) -> Result<Option<String>>
Expand description

Commit tree directly, bypassing the live index.

Used when the index drifted while a message was being generated: the analyzed snapshot is committed as-is, the branch (or detached HEAD) advances, and the index and worktree are left untouched — anything staged mid-run stays staged for a later commit. Commit hooks do not run.

Returns Ok(None) when tree is already HEAD’s tree (the same content was committed mid-run), Ok(Some(hash)) otherwise.