pub fn delete_worktree(
target: Option<&str>,
keep_branch: bool,
delete_remote: bool,
force: bool,
allow_busy: bool,
lookup_mode: Option<&str>,
) -> Result<()>Expand description
Delete a worktree by branch name, worktree directory name, or path.
§Parameters
force— historicalgit worktree remove --forcesemantic. Forwarded togit::remove_worktree_safe; controls whether git itself will remove a worktree with uncommitted changes. Defaults totrueat the CLI.allow_busy— bypass the gw-level busy-detection gate (lockfile + process cwd scan). Wired to the explicit--forceCLI flag on the delete subcommand so users can override “worktree is in use” refusals.
These two flags are intentionally separate: the CLI --force is an
affirmative user choice to bypass the busy check, whereas the git-force
behaviour is a long-standing default that users rarely flip off.