forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle git add <file>
where <file> traverses an NTFS junction
#2504
Merged
Conversation
This file contains 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
NTFS junctions are somewhat similar in spirit to Unix bind mounts: they point to a different directory and are resolved by the filesystem driver. As such, they appear to `lstat()` as if they are directories, not as if they are symbolic links. _Any_ user can create junctions, while symbolic links can only be created by non-administrators in Developer Mode on Windows 10. Hence NTFS junctions are much more common "in the wild" than NTFS symbolic links. It was reported in git-for-windows#2481 that adding files via an absolute path that traverses an NTFS junction: since 1e64d18 (mingw: do resolve symlinks in `getcwd()`), we resolve not only symbolic links but also NTFS junctions when determining the absolute path of the current directory. The same is not true for `git add <file>`, where symbolic links are resolved in `<file>`, but not NTFS junctions. Signed-off-by: Johannes Schindelin <[email protected]>
Some platforms (e.g. Windows) provide API functions to resolve paths much quicker. Let's offer a way to short-cut `strbuf_realpath()` on those platforms. Signed-off-by: Johannes Schindelin <[email protected]>
There is a Win32 API function to resolve symbolic links, and we can use that instead of resolving them manually. Even better, this function also resolves NTFS junction points (which are somewhat similar to bind mounts). This fixes git-for-windows#2481. Signed-off-by: Johannes Schindelin <[email protected]>
4e017d2
to
100d194
Compare
drizzd
approved these changes
Jan 31, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Thanks @drizzd! |
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 1, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 1, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 1, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 1, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 5, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 5, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 5, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 6, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 10, 2020
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 7, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
Merged
dscho
added a commit
to dscho/git
that referenced
this pull request
Jan 7, 2025
…nction Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
to dscho/git
that referenced
this pull request
Jan 7, 2025
…nction Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 7, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 7, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 9, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 9, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Jan 17, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 27, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 28, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 28, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 3, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 5, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 5, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 5, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 5, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 6, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
that referenced
this pull request
Feb 6, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 6, 2025
Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
to dscho/git
that referenced
this pull request
Feb 6, 2025
…nction Handle `git add <file>` where <file> traverses an NTFS junction
dscho
added a commit
to dscho/git
that referenced
this pull request
Feb 6, 2025
…nction Handle `git add <file>` where <file> traverses an NTFS junction
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.
This is intended to fix #2481