{"version":"2.1.274","anchor":"worktree-keepreap-dirty-check-reworked-around-git-existenc","canonical_anchor":"worktree-keepreap-dirty-check-reworked-around-git-existenc","heading":"Worktree keep\/reap dirty-check reworked around .git existence","tier":"internal","area":"Git Worktrees","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.274\/e\/worktree-keepreap-dirty-check-reworked-around-git-existenc","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.274","markdown":"### Worktree keep\/reap dirty-check reworked around .git existence\n\nWorktree cleanup now checks whether the .git file still exists before assuming a worktree is safe to remove\n\n**What**\n\nThe 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.\n\n**Why**\n\nThis 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.\n\n- Area: Git Worktrees\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 1\/5"}