Add support for usernames in git resolver (Take 2) #934
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The Git resolver did not understand usernames in URLs, e.g.
git+ssh://[email protected]/...
due to it treating any pattern containing@
as being "un-exploded". See 4112050, #513.For me it was falling through, and calling the npm resolver instead. The package wasn't published on the registry, so it was erroring there. For others, it would error due to version mismatches if it was on the registry.
Instead, it's now simply treating any
pattern
with no protocol as being invalid. There's no valid npm git URL without a protocol.Example failing pattern from before:
Test plan
Added test, they pass.
Btw I've noticed
https://github.com/npm-ml/ocaml.git#npm-4.02.3
times out a lot.