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

Wrong parsing for git URL with path containing more than 2 elements #44

Closed
pvdlg opened this issue Jan 6, 2018 · 1 comment
Closed

Comments

@pvdlg
Copy link
Contributor

pvdlg commented Jan 6, 2018

With 2 elements in the path:

GitUrlParse("git@github.com:a/b.git");
{ protocols: [],
  protocol: 'ssh',
  port: null,
  resource: 'github.com',
  user: 'git',
  pathname: '/a/b.git',
  hash: '',
  search: '',
  href: 'git@github.com:a/b.git',
  token: '',
  toString: [Function],
  source: 'github.com',
  name: 'b',
  owner: 'a',
  organization: 'git',
  full_name: 'a/b' }

Everything seems correct except the organization that is set to git.

With more than 2 elements in the path:

GitUrlParse("git@github.com:a/b/c/d.git");
{ protocols: [],
  protocol: 'ssh',
  port: null,
  resource: 'github.com',
  user: 'git',
  pathname: '/a/b/c/d.git',
  hash: '',
  search: '',
  href: 'git@github.com:a/b/c/d.git',
  token: '',
  toString: [Function],
  source: 'github.com',
  name: 'a/b/c/d',
  owner: 'git',
  organization: 'git',
  full_name: 'git/a/b/c/d' }

The name, owner, organization and full_name are wrong.

This type of URL are valid for GitLab repositories in a sub-group: https://docs.gitlab.com/ee/user/group/subgroups/index.html

@IonicaBizau
Copy link
Owner

Hmm, interesting... Currently I'm busy with other things, but I'd be very happy if somebody debugged this and submit a PR.

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

2 participants