Skip to main content

create_commit

Function create_commit 

Source
pub fn create_commit(
    repo: &Repository,
    req: &CommitRequest,
    progress: &mut dyn ProgressSink,
) -> Result<CommitOutcome>
Expand description

Write a commit from the current index and advance the checked-out branch.

Loads the index from disk, builds the commit tree with an incremental cache-tree write-tree, writes the commit object, writes the index back with an updated cache-tree, then atomically updates the branch ref and reflogs (see crate::refs::update_branch_for_commit_on_store).

§Parameters

  • repo — open repository with a work tree and branch HEAD.
  • req — message, author/committer identities, and empty-commit policy.
  • progress — optional progress sink (single commit phase).

§Errors