Skip to content

Windows: symbolic links with .. are not created correctly #5424

@ehuss

Description

@ehuss

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

  1. 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
  2. Have a libgit2 project which will clone the sample repo.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions