Skip to content

Stale ("prunable") worktree is hidden from the UI but still blocks branch deletion #2701

Description

@k-sav

When a worktree's directory is deleted out from under Fork (common with worktrees under /tmp, which the OS reaps), Fork silently omits the worktree from its UI — but git still considers the branch checked out by that dead worktree entry, so deleting the branch fails with no explanation visible in Fork.

Repro:

  1. Create a worktree in a temp location: git worktree add /tmp/wt-foo my-branch
  2. Delete the directory (or let the OS clear /tmp): rm -rf /tmp/wt-foo
  3. In Fork, the worktree no longer appears in the sidebar.
  4. Try to delete my-branch in Fork → it fails / the branch appears stuck, because git still holds the checkout lock from the orphaned worktree registration in .git/worktrees/.

git worktree list reports the entry as prunable; git worktree prune clears it and the branch then deletes normally.

Expected: Fork should surface prunable/stale worktrees rather than hiding them — e.g. show them dimmed as "missing" with a prune action, or reconcile them (equivalent to git worktree prune) when it detects the directory is gone, so branch deletion isn't silently blocked.

This is a different symptom of the same underlying gap as #2679 (there, the stale worktree triggers a loud "contact support" error; here it's a silent hide plus a hidden branch-delete block). Both would be resolved by pruning stale worktree references.

Environment: Fork for Mac 2.69.0 / macOS. Worktree directory under /private/tmp.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions