Skip to content

Cloning a repo on Windows breaks symlinks #4107

@bquistorff

Description

@bquistorff

I can't clone faithfully repos with symlinks on Windows. I have been able to do this using Git for Windows (info) when in Administrator mode and setting core.symlinks=true.

Reproduction steps

I am using libgit2 through R with the git2r package.
Start R in administrator mode

> git2r::config()
programdata:
        color.branch=auto
        color.diff=auto
        color.interactive=true
        color.status=auto
        core.autocrlf=true
        core.fscache=true
        core.symlinks=true
        diff.astextplain.textconv=astextplain
        help.format=html
        http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
        rebase.autosquash=true
global:
        core.symlinks=true
        filter.lfs.clean=git-lfs clean -- %f
        filter.lfs.process=git-lfs filter-process
        filter.lfs.required=true
        filter.lfs.smudge=git-lfs smudge -- %f
> git2r::clone("git://github.com/imbs-hl/ranger.git", "C:/Users/USER/Documents/GitHub/ranger2", progress = FALSE)
Local:    master C:/Users/USER/Documents/GitHub/ranger2/
Remote:   master @ origin (git://github.com/imbs-hl/ranger.git)
Head:     [47eb75a] 2017-01-20: Merge pull request #157 from imbs-hl/fix_extratrees

Expected behavior

Expect many symlink files in ranger-r-package/ranger/src folder.

Actual behavior

Many text files in ranger-r-package/ranger/src folder where file contents are the original symlink target paths.

Version of libgit2 (release number or SHA1)

git2r version 0.18.0.9000 (latest release) which say that it has libgit2 commit 6b0510e from 20 December 2016

Operating system(s) tested

Windows 10 Enterprise

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