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

Bare local paths crash since parse-url 8.x #157

Open
themightychris opened this issue Feb 22, 2023 · 0 comments
Open

Bare local paths crash since parse-url 8.x #157

themightychris opened this issue Feb 22, 2023 · 0 comments

Comments

@themightychris
Copy link

themightychris commented Feb 22, 2023

parse-url 8.x deprecated support for URLs that just start with a / for a local path like /tmp/myrepo. They have to be prefixed with file:// now or you get:

Uncaught Error: URL parsing failed.

I get their rationale for dropping support for that but I wonder if it was intended that git-url-parse lose the same support? I'd like my application depending on git-url-parse to be able to handle any URL that the official git client does and right now git-url-parse throws errors for these URLs that are valid in git configs

Would it make sense for the git-url-parse or git-up projects to contain logic layered above parse-url for handling local paths?

A simple implementation might just be detecting input strings that start with / and prefixing them with file:// automatically before passing to parse-url

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

1 participant