-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Windows: directory relative symlinks do not work #5252
Comments
What does Git for Windows do here? What are the files that it creates? I ask because it's not clear to me if both systems need to be fixed or if this is a limitation of libgit2 only. |
It translates forward slashes to backslashes (source). |
Thanks for validating this, that makes sense and we should match their behavior indeed. |
Any news regarding this issue? |
When cloning a repository with symbolic links, the links will end up with forward slashes. These files cannot be read using typical APIs like
CreateFileW
(withoutFILE_FLAG_OPEN_REPARSE_POINT
) which result inERROR_INVALID_NAME
. This assumes you havecore.symlinks
to true and have the necessary developer mode enabled.Reproduction steps
mkdir somedir
echo contents > somedir\foo
mklink foo somedir\foo
10/01/2019 06:43 PM <SYMLINK> foo [somedir/foo]
Also notice that these files cannot be opened using Windows apis (like in Notepad). Beware that msys tools (like
cat
) seem to be able to access them. I would guess that maybe they useFILE_FLAG_OPEN_REPARSE_POINT
, read the link content, and translate the path manually.Expected behavior
Should be able to open symlinked files on windows.
Actual behavior
Files fail to open.
Version of libgit2 (release number or SHA1)
08cfa43
Operating system(s) tested
Windows 10
The text was updated successfully, but these errors were encountered: