Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Added support for non-symlink checkouts on Windows when elevated rights are missing #768

Closed
wants to merge 1 commit into from
Closed

Added support for non-symlink checkouts on Windows when elevated rights are missing #768

wants to merge 1 commit into from

Conversation

fkollmann
Copy link

On Windows, elevated rights are required for symlinks.

If they are missing, which is true for almost all users, the library will fail with "A required privilege is not held by the client." (ERROR_PRIVILEGE_NOT_HELD).

This change will handle the error and write the file, instead of trying to create a symlink.

@mcuadros
Copy link
Contributor

mcuadros commented Mar 3, 2018

This is how behaves git on windows?

@fkollmann
Copy link
Author

fkollmann commented Mar 7, 2018

Got on Windows behaves in two different ways:

a) Developer Mode: Git will create Symlinks
b) Normal Mode: Git will simply create a file containing the file path (basically creating useless garbage)

For case (a) there is an ongoing fix at Go: golang/go#22874
For case (b) this PR will produce a more reasonable behavior, as the file will get the correct content (on clean checkout, only)

See https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/ for technical details

@fkollmann
Copy link
Author

I will close this PR in favor of an implementation that mimics the behavior of Go on Windows: #776

@fkollmann fkollmann closed this Mar 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants