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

Correctly resolve mapped drive on Windows #114642

Merged

Conversation

egfx-notifications
Copy link
Contributor

Backport of a fix from https://github.com/eamodio/vscode-gitlens as requested by @eamodio

fs.realpath.native in NodeJS uses the Win32 API function GetFinalPathNameByHandle() on Windows hosts,
therefore a given path must follow the guidelines for Win32 API file functions.
Drive letters on Windows need to end on a backslash according to the Win32 File Naming Conventions (https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file)
Omitting the backslash results in Windows treating the remaining path components as a relative path starting from the current directory on the specified disk
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths

For further details please check the discussion to the original issue gitkraken/vscode-gitlens#1045

fs.realpath.native in NodeJS uses the Win32 API function GetFinalPathNameByHandle() on Windows hosts,
therefore a given path must follow the guidelines for Win32 API file functions.
Drive letters on Windows need to end on a backslash according to the Win32 File Naming Conventions (https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file)
Omitting the backslash results in Windows treating the remaining path components as a relative path starting from the current directory on the specified disk
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths
@eamodio eamodio self-assigned this Jan 20, 2021
@eamodio eamodio added this to the January 2021 milestone Jan 20, 2021
@eamodio eamodio merged commit cbbf2d0 into microsoft:master Jan 20, 2021
@egfx-notifications egfx-notifications deleted the fix/mapped-drive-windows branch January 20, 2021 16:59
@eamodio
Copy link
Contributor

eamodio commented Jan 20, 2021

Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2021
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