Skip to main content

commit_with_patch

Function commit_with_patch 

Source
pub fn commit_with_patch(
    repo: &Repository,
    req: &CommitRequest,
    input: CommitPatchInput,
    pathspecs: &[String],
    progress: &mut dyn ProgressSink,
    cancel: &dyn Cancel,
) -> Result<CommitOutcome, CommitPatchError>
Expand description

Record a commit after applying input to the current index (partial stage + commit).

Applies the selection in memory, commits the resulting tree, then writes the updated index. Does not auto-stage the worktree (same effective scope as CommitScope::Staged).

ยงErrors

CommitPatchError::Select for hunk id failures; CommitPatchError::Apply for patch apply; same commit errors as create_commit.