-
Notifications
You must be signed in to change notification settings - Fork 467
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
fix: improve git remoteUrl parsing #4147
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great call, and of course the JS world has a parser already which probably covers 99% of the common cases as well by now.
So I'd say, despite my recommendation, let's use it until it breaks :).
import { expect, test, describe } from 'vitest'; | ||
|
||
const exampleRemoteUrls = [ | ||
'ssh://user@host.xz:123/org/repo.git/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am loving this!
Love this @ndom91!! If you're up for it, do you want to change |
☕️ Reasoning
🧢 Changes
git-url-parse
(https://github.com/IonicaBizau/git-url-parse) [~3.5kb minified + gzipped
]git
supports, so maybe the manual parsing we had was sufficient for the time beingGitHubService
to ensure thatowner
/repo
are parsed out as expectedOut of the 22 URLs I added to test, the previous implementation only parsed 13/22 correctly.