Don't traverse mount points in remove_dir_recurse()#6151
Merged
dscho merged 1 commit intogit-for-windows:mainfrom Mar 31, 2026
Merged
Don't traverse mount points in remove_dir_recurse()#6151dscho merged 1 commit intogit-for-windows:mainfrom
remove_dir_recurse()#6151dscho merged 1 commit intogit-for-windows:mainfrom
Conversation
It was already decided in ef22148 (clean: do not traverse mount points, 2018-12-07) that we shouldn't traverse NTFS junctions/bind mounts when using `git clean`, partly because they're sometimes used in worktrees. But the same check wasn't applied to `remove_dir_recurse()` in `dir.c`, which `git worktree remove` uses. So removing a worktree suffers the same problem we had previously with `git clean`. Let's add the same guard from ef22148. Signed-off-by: Maks Kuznia <makskuznia244@gmail.com>
Member
|
/add relnote bug Similar to how The workflow run was started |
github-actions bot
pushed a commit
to git-for-windows/build-extra
that referenced
this pull request
Mar 31, 2026
Similar to how `git clean` already avoids traversing NTFS junctions, `git worktree remove` [now does the same](git-for-windows/git#6151). Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
gitforwindowshelper bot
pushed a commit
that referenced
this pull request
Apr 1, 2026
`remove_dir_recurse()` in `dir.c` doesn't check for mount points, even though this check was already added for `git clean` in #2268. So `git worktree remove` (or anything else that calls it) will traverse NTFS junctions and delete whatever is there. Similar to #607. This extends the same check from #2268 but for anything that calls `remove_dir_recurse()`.
gitforwindowshelper bot
pushed a commit
to git-for-windows/shears-builds
that referenced
this pull request
Apr 1, 2026
…s#6151) `remove_dir_recurse()` in `dir.c` doesn't check for mount points, even though this check was already added for `git clean` in git-for-windows#2268. So `git worktree remove` (or anything else that calls it) will traverse NTFS junctions and delete whatever is there. Similar to git-for-windows#607. This extends the same check from git-for-windows#2268 but for anything that calls `remove_dir_recurse()`.
This was referenced Apr 2, 2026
gitforwindowshelper bot
pushed a commit
that referenced
this pull request
Apr 2, 2026
`remove_dir_recurse()` in `dir.c` doesn't check for mount points, even though this check was already added for `git clean` in #2268. So `git worktree remove` (or anything else that calls it) will traverse NTFS junctions and delete whatever is there. Similar to #607. This extends the same check from #2268 but for anything that calls `remove_dir_recurse()`.
gitforwindowshelper bot
pushed a commit
to git-for-windows/shears-builds
that referenced
this pull request
Apr 2, 2026
…s#6151) `remove_dir_recurse()` in `dir.c` doesn't check for mount points, even though this check was already added for `git clean` in git-for-windows#2268. So `git worktree remove` (or anything else that calls it) will traverse NTFS junctions and delete whatever is there. Similar to git-for-windows#607. This extends the same check from git-for-windows#2268 but for anything that calls `remove_dir_recurse()`.
gitforwindowshelper bot
pushed a commit
that referenced
this pull request
Apr 2, 2026
`remove_dir_recurse()` in `dir.c` doesn't check for mount points, even though this check was already added for `git clean` in #2268. So `git worktree remove` (or anything else that calls it) will traverse NTFS junctions and delete whatever is there. Similar to #607. This extends the same check from #2268 but for anything that calls `remove_dir_recurse()`.
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.
remove_dir_recurse()indir.cdoesn't check for mount points, even though this check was already added forgit cleanin #2268. Sogit worktree remove(or anything else that calls it) will traverse NTFS junctions and delete whatever is there. Similar to #607.This extends the same check from #2268 but for anything that calls
remove_dir_recurse().