Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trailing / not read on a symlink when nativestrict is set and target does not exist #1027

Closed
rupebac opened this issue Jan 9, 2017 · 1 comment

Comments

@rupebac
Copy link

rupebac commented Jan 9, 2017

  • [ x ] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Git 2.11.0 x64
$ git --version --build-options
$ git --version --build-options
git version 2.11.0.windows.1
sizeof-long: 4
machine: x86_64

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 6.3.9600]_
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
Enable Builtin Difftool: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

No

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

mingw


developer@Rhea MINGW64 /d/workspace/develop ((24c214e...))
$ export MSYS=winsymlinks:nativestrict

developer@Rhea MINGW64 /d/workspace/develop ((24c214e...))
$ rm buildSrc

developer@Rhea MINGW64 /d/workspace/develop ((24c214e...))
$ git show HEAD:buildSrc
build/buildSrc/

developer@Rhea MINGW64 /d/workspace/develop ((24c214e...))
$ git reset --hard
HEAD is now at 24c214e NONE: buildSrc symlink

developer@Rhea MINGW64 /d/workspace/develop ((24c214e...))
$

  • What did you expect to occur after running these commands?

The symbolic link buildSrc should be created as a SYMLINKD instead of as a SYMLINK.
When I go into the mingw bash, and make the link manually with ln -s, then it works as expected (proves the MSYS variable was set).

It seems that git is ignoring the trailing / in the symlink, and it should not as of:
git-for-windows/msys2-runtime#10

  • What actually happened instead?

Unusable SYMLINK is created. Even if I create the target directory later, the symlink is unusable from the Windows explorer.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

no

@dscho
Copy link
Member

dscho commented Mar 28, 2022

git.exe does not use the MSYS2 runtime. Therefore, the nativestrict setting is irrelevant.

Git has no concept of directory symlinks, and therefore needs a bit of help. You need to use the symlink=dir attribute (see git help gitattributes for details).

@dscho dscho closed this as completed Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants