Skip to content

Correctly resolve mapped drive on Windows - #114642

Merged
Eric Amodio (eamodio) merged 1 commit into
microsoft:masterfrom
egfx-notifications:fix/mapped-drive-windows
Jan 20, 2021
Merged

Eric Amodio (eamodio) merged 1 commit into
microsoft:masterfrom
egfx-notifications:fix/mapped-drive-windows

Conversation

@egfx-notifications

Copy link
Copy Markdown
Contributor

Backport of a fix from https://github.com/eamodio/vscode-gitlens as requested by Eric Amodio (@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 Eric Amodio (eamodio) self-assigned this Jan 20, 2021
@eamodio Eric Amodio (eamodio) added this to the January 2021 milestone Jan 20, 2021
@eamodio
Eric Amodio (eamodio) merged commit cbbf2d0 into microsoft:master Jan 20, 2021
@egfx-notifications
Florian Schwalm (egfx-notifications) deleted the fix/mapped-drive-windows branch January 20, 2021 16:59
@eamodio

Copy link
Copy Markdown
Contributor

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.

2 participants