Skip to main content

prune_worktrees

Function prune_worktrees 

Source
pub fn prune_worktrees(
    repo: &Path,
    current_path: &Path,
    protected_paths: &HashSet<PathBuf>,
    policy: WorktreePrunePolicy,
    dry_run: bool,
) -> Result<WorktreePruneReport, GitError>
Expand description

Remove clean worktrees with terminal evidence or manual abandonment evidence.

Merged, squash-landed, closed-PR, and remote-gone branches are terminal. Manual pruning additionally removes branches with no activity for seven days, unless their current head has an open PR. Explicit wt remove --force is the destructive escape hatch; no prune path removes uncommitted files.