Skip to content

Worktree status check silently treats errors as clean #78

@wollax

Description

@wollax

Problem

In handle_worktree_cleanup, the dirty state check uses unwrap_or(false) on the status() call result. If status fails for a reason other than "not found" (e.g., corrupted git state), it silently treats the worktree as clean, potentially skipping the interactive confirmation prompt and deleting a worktree with uncommitted changes.

Solution

Solution

Distinguish between "not found" errors (treat as proceed) and other errors (propagate or warn). Consider matching on error variant to handle WorktreeNotFound specifically.


Created via Kata PR review backlog

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogKata backlog issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions