Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Storage cleanup fails every run on a worktree folder that lost its .git (Windows) #37276

Closedjesseroldan-sb(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • 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

  1. 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>.
  2. 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, ...).
  3. 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.

#17813, #25843, #14990

  • Opus 5.5
  1. 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.

  2. juliusmarminge closed this

Sign in to join this conversation.