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

git type URL are parsed incorrectily #17

Closed
pvdlg opened this issue Oct 24, 2018 · 4 comments
Closed

git type URL are parsed incorrectily #17

pvdlg opened this issue Oct 24, 2018 · 4 comments

Comments

@pvdlg
Copy link

pvdlg commented Oct 24, 2018

const gitUp = require('git-up');
gitUp('git@github.com:IonicaBizau/git-stats.git');
// { protocols: [ 'http' ],
//   protocol: 'ssh',
//   port: null,
//   resource: 'github.com',
//   user: 'git',
//   pathname: '/:IonicaBizau/git-stats.git',
//   hash: '',
//   search: '',
//   href: 'http://git@github.com/:IonicaBizau/git-stats.git',
//   query: {},
//   token: '' }

href is wrongly set to http://git@github.com/:IonicaBizau/git-stats.git
protocols is wrongly set to ['http']

This is because git-up calls parse-url which calls normalize-url.
normalize-url throws an error for git URL:

const normalizeUrl = require('normalize-url');
normalizeUrl('git@github.com:IonicaBizau/git-stats.git');
[ERR_INVALID_URL]: Invalid URL: http:git@github.com:IonicaBizau/git-stats.git
@IonicaBizau
Copy link
Owner

Thanks for reporting this and sorry for the inconvenience—I just discovered that there was a try-catch in the tests, which was making them to pass, all. 🙈

I did some breaking changes in parse-url, parse-path and git-up and I mentioned you to review them

@pvdlg
Copy link
Author

pvdlg commented Oct 26, 2018

@IonicaBizau, any update on this? I reviewed your PRs and I think they are good to go. Do you know when you can merge and release them? This issue is impacting a lot of folks... Thanks!

@IonicaBizau
Copy link
Owner

@pvdlg I got the chance to work on this finally. Released the major versions of the dependencies, releasing this now as well. 🚀

@pvdlg
Copy link
Author

pvdlg commented Oct 28, 2018

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants