pub fn commit_with_scope(
repo: &Repository,
req: &CommitRequest,
scope: CommitScope,
progress: &mut dyn ProgressSink,
cancel: &dyn Cancel,
) -> Result<CommitOutcome>Expand description
Record a commit using scope to decide how the index is prepared.
Staging reports crate::progress::ProgressPhase::StagingFiles to progress; cancel (or
ProgressSink::should_cancel) stops the commit with Error::Cancelled up to the point
the commit object is written, leaving HEAD and the branch where they were.
ยงErrors
Same as create_commit and commit_worktree, plus:
Error::CommitPathsRequiredfor an emptyCommitScope::Pathslist.Error::PartialCommitDuringMergeforCommitScope::PathsorCommitScope::Patchduring an in-progress merge, and pathspec validation errors.Error::HunkSelectionwhen aCommitScope::Patchhunk id is unknown, stale, binary, or for the wrong side, andError::Applywhen the selected patch does not apply to the index. These carry the same values asCommitPatchError::SelectandCommitPatchError::Applyfromcommit_with_patch.