-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
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 (without FILE_FLAG_OPEN_REPARSE_POINT) which result in ERROR_INVALID_NAME. This assumes you have core.symlinks to true and have the necessary developer mode enabled.
Reproduction steps
- Create a repository with a file symbolic link between directories. For example:
mkdir somedirecho contents > somedir\foomklink foo somedir\foo- Init a repo, and add these two files
- Have a libgit2 project which will clone the sample repo.
- Notice that the resulting files have forward slashes, like this:
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 (likecat) 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)
Operating system(s) tested
Windows 10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels