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

Bitbucket path with /src/ instead of /tree/ or /blob/ #101

Closed
onhate opened this issue Jun 24, 2019 · 2 comments
Closed

Bitbucket path with /src/ instead of /tree/ or /blob/ #101

onhate opened this issue Jun 24, 2019 · 2 comments
Labels

Comments

@onhate
Copy link

onhate commented Jun 24, 2019

Hi, when running gitUrlParse('https://bitbucket.org/org-name/project-name/src/master/ops/assets/'); I would expected to receive this

{
  "protocols": [
    "https"
  ],
  "protocol": "https",
  "port": null,
  "resource": "bitbucket.org",
  "user": "",
  "pathname": "/org-name/project-name/src/master/ops/assets",
  "hash": "",
  "search": "",
  "href": "https://bitbucket.org/org-name/project-name/src/master/ops/assets",
  "token": "",
  "source": "bitbucket.org",
  "git_suffix": false,
  "name": "project-name",
  "owner": "org-name",
  "commit": "master",
  "ref": "master",
  "filepathtype": "src",
  "filepath": "ops/assets",
  "organization": "org-name",
  "full_name": "org-name/project-name"
}

but instead I'm getting

{
  "protocols": [
    "https"
  ],
  "protocol": "https",
  "port": null,
  "resource": "bitbucket.org",
  "user": "",
  "pathname": "/org-name/project-name/src/master/ops/assets",
  "hash": "",
  "search": "",
  "href": "https://bitbucket.org/org-name/project-name/src/master/ops/assets",
  "query": {},
  "token": "",
  "source": "bitbucket.org",
  "git_suffix": false,
  "name": "assets",
  "owner": "org-name/project-name/src/master/ops",
  "ref": "",
  "filepathtype": "",
  "filepath": "",
  "organization": "org-name/project-name/src/master/ops",
  "full_name": "org-name/project-name/src/master/ops/assets"
}

Just as a matter of test, if I changes /src/ with /tree/ it works fine and gives me:

{
  "protocols": [
    "https"
  ],
  "protocol": "https",
  "port": null,
  "resource": "bitbucket.org",
  "user": "",
  "pathname": "/org-name/project-name/tree/master/ops/assets",
  "hash": "",
  "search": "",
  "href": "https://bitbucket.org/org-name/project-name/tree/master/ops/assets",
  "query": {},
  "token": "",
  "source": "bitbucket.org",
  "git_suffix": false,
  "name": "project-name",
  "owner": "org-name",
  "commit": "master",
  "ref": "master",
  "filepathtype": "tree",
  "filepath": "ops/assets",
  "organization": "org-name",
  "full_name": "org-name/project-name"
}
@tunnckoCore
Copy link

Yup. Okay, i'm not surprised that parse-github-url works for this case :)

Jon is really damn good at creating stable packages :)

Just mentioning that, because I need a universal parser of git urls and tried your example and gave me correct output that you expect.

@IonicaBizau IonicaBizau added the bug label Sep 4, 2020
@goober
Copy link
Contributor

goober commented Nov 8, 2020

@onhate This should have been fixed by #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants