When cloning a directory with symbolic links that contain .. on Windows, the .. segments are silently discarded, resulting in a broken symlink.
Note that this was recently changed in #5355. cc @pks-t
Reproduction steps
- Create a repository with a file symbolic link between directories. For example:
echo contents > foo
mkdir somedir
mklink somedir\foo ..\foo
- Init a repo, and add these two files
- Have a libgit2 project which will clone the sample repo.
- Notice that the resulting symlink is "foo -> foo"
Expected behavior
.. should be preserved in the symlink.
Actual behavior
.. is removed from symlink.
Version of libgit2 (release number or SHA1)
1722390
Operating system(s) tested
Windows 10