Under the hood
Worktree cleanup now checks whether the .git file still exists before assuming a worktree is safe to remove
What
The internal function that decides whether to keep or discard a git worktree (a separate working copy of a repository) now checks whether the worktree's .git file still exists before treating it as clean. Previously, the fast path assumed a worktree was clean whenever it had no recorded head commit, without this check.
Why
This avoids incorrectly treating a worktree as safe to discard just because its head commit info is missing, reducing the risk of losing work in edge cases where the worktree's git link is in an unusual state.