You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Storage cleanup fails every run on a worktree folder that lost its .git (Windows) #37276
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
On Windows, a thread's worktree contains a directory junction: a node_modules junction to the main checkout, or the one a Next.js dev build creates at .next\dev\node_modules\@sentry\server-runtime-injection-<hash>.
Removing the worktree stops partway: .git and most files are gone, but the folder stays with the junction and a few files (package.json, README.md, ...).
Let Storage Cleanup run.
Expected behavior
A folder in the managed worktrees directory whose .git is gone is treated as leftover: removed (unlinking junctions without following them), or listed as an orphan in Settings → Storage.
Actual behavior
Every run logs, for the thread that owned it:
storage cleanup failed for worktree
reason: NotFound, FileSystem.stat
path: C:\Users\<user>\Developer\.worktrees\<repo>\t3-<id>\.git
ENOENT: no such file or directory
The folder is never removed or shown as removable, and the failure repeats every hour. I had 29 of these.
Impact
Minor bug or occasional failure
Version or commit
0.1.7
Environment
Windows 11, git for Windows, Next.js 16 project.
Workaround
Unlink each junction (Node's fs.unlinkSync removes the link, not its target), then delete the folder.
Activity
juliusmarminge commentedon Nov 15, 2026
This is the same problem as #24390, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.