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

Unable to get absolute uri between ex.txt and z:; Base path 'z:' must be an absolute path #1928

Closed
rasa opened this issue Mar 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working needs-verification Request for verification
Milestone

Comments

@rasa
Copy link
Contributor

rasa commented Mar 26, 2022

In Windows, if I edit the file ex.txt in the root of a mapped network drive, say Z:\, I get this error:

Unable to get absolute uri between ex.txt and z:; Base path 'z:' must be an absolute path

This is because this code:

if (path.charCodeAt(path.length - 1) === slash) {
path = path.slice(0, -1);
}

is removing the trashing slash. This works for all paths except for paths in the root folder, where the trailing slash should remain. This could be fixed via:

if (path.charCodeAt(path.length - 1) === slash) { 
  // Don't remove the trailing slash on Windows root folders, such as z:\
  if (path.length != 3 || (path.length == 3 && path.charCodeAt(1)  != ':')) {
    path = path.slice(0, -1); 
  }
} 
rasa added a commit to rasa/vscode-gitlens that referenced this issue Mar 26, 2022
@eamodio eamodio self-assigned this Mar 31, 2022
@eamodio eamodio added bug Something isn't working needs-verification Request for verification pending-release Resolved but not yet released to the stable edition labels Mar 31, 2022
@eamodio eamodio added this to the Soon™ milestone Mar 31, 2022
@eamodio
Copy link
Member

eamodio commented Mar 31, 2022

Can you please verify this fix in tomorrow's GitLens insiders edition?

You can install the GitLens insiders edition from here.

Please be sure to disable or uninstall the stable version of GitLens first.

@github-actions
Copy link

github-actions bot commented May 1, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2022
@eamodio eamodio removed the pending-release Resolved but not yet released to the stable edition label May 16, 2022
@eamodio eamodio modified the milestones: Soon™, Shipped May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs-verification Request for verification
Projects
None yet
Development

No branches or pull requests

2 participants