Skip to main content

apply_worktree

Function apply_worktree 

Source
pub fn apply_worktree(
    guard: &WorktreeGuard,
    mode: ApplyMode,
    message: &str,
    base: Option<&str>,
) -> Result<ApplySuccess, ConflictError>
Expand description

Apply the worktree’s changes: commit → merge into base OR commit → push → PR.

On success the worktree and its branch are removed (via the existing remove_worktree_sync helper). On merge conflict, git merge --abort is called so the base repo is never left mid-merge, and the worktree + branch are cleaned up before returning the conflict list.