Repository navigation
Conversation
Since 8065242 (dir: do not traverse mount points, 2026-03-30), `git worktree remove --force` no longer deletes what an NTFS junction inside the worktree points to. But it now keeps the junction, which keeps every directory above it, and it still exits 0 without a word: the worktree is unregistered while its directory stays behind. A `node_modules` junction made to share dependencies with another checkout is enough to see it. On Windows, `git clean` already removes such a junction itself (`CAN_UNLINK_MOUNT_POINTS`): `unlink()` removes the link and leaves the target alone. Do the same in `remove_dir_recurse()`, and keep the junction as before when that fails, when only empty directories are to be removed, or when the top-level directory is to be kept. Assisted-by: Claude Opus 5.5 Signed-off-by: ppcvote <198151518+ppcvote@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #6151. Reproduced with Git for Windows 2.56.0.windows.4 (MinGit): after
git worktree remove --force wton a worktree holding anode_modulesjunction, the junction target is intact (thanks to #6151), butwt\and the junction are still there, the command exits 0, andgit worktree listno longer showswt. With this change,t2403(34/34, the extended mount-point test fails without thedir.chunk),t7300,t2401,t2402andt2405pass locally (built with the minimal SDK,NO_RUST=1).Written with Claude Code (hence the
Assisted-by:trailer); ppcvote is run by Ultra Lab.🤖 Generated with Claude Code