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
Slash in revision name #104
Comments
Can you add an example? |
@IonicaBizau dependabot branches are a very good example: https://github.com/spotify/backstage/blob/dependabot/npm_and_yarn/testing-library/jest-dom-5.11.4/package.json |
I created a failing test #114 |
it's possible to get all the branches from githubs api using: https://api.github.com/repos/node-fetch/node-fetch/branches b/c the parsing is synchronous, i propose that you make it possible to pass in an option with all the branch names that are available... Something like: // const branches = await fetch('https://api.github.com/repos/node-fetch/node-fetch/branches')
// .then(r => r.json()).then(j => j.map(e => e.name))
const branches = [
"1.x",
"2.x",
"beta",
"dependabot/npm_and_yarn/formdata-node-5.0.0",
"dependabot/npm_and_yarn/mocha-10.2.0",
"dependabot/npm_and_yarn/p-timeout-6.1.1",
"dependabot/npm_and_yarn/tsd-0.25.0",
"dependabot/npm_and_yarn/xo-0.53.1",
"main"
]
const url = 'https://github.com/node-fetch/node-fetch/blob/dependabot/npm_and_yarn/p-timeout-6.1.1/.gitignore'
GitUrlParse(url, { branches }) Only if the user needs to get the branches in order to get the correct file path would they need to do this fetching more manually then if the branch name can't be found in the list then it would just assume that the branch name dose not include any |
We recently ran into the same issue when using backstage (which internally uses We would be willing to implement this feature and provide a PR. But first we want to make sure it is something you are interested in before we start working on it. |
if there's a
/
in revision name (either fortag
orbranch
) then url is parsed in a wrong manner and cuts the revision name from the existing/
. so for e.g if branch name isfeature/foo
then git-url-parse would fetch the revision name asfeature
leaving/foo
out.The text was updated successfully, but these errors were encountered: