Fix for issue #25 - Add support for branches with '/' in them#72
Fix for issue #25 - Add support for branches with '/' in them#72matt-watson90 wants to merge 2 commits intopomber:masterfrom
Conversation
Use the branches API to figure out all the branches present in the repo and then split the path in to branch and fileName. The contents API needs the branchname in the 'ref' field and the commits api uses it in the 'sha' field.
|
@pomber It looks like the build is failing because of an existing problem in master with prettier and ReadMe.md |
|
Thanks @matt-watson90 .
Maybe we could try your approach after there is a 404. Keep the current approach, if the commits request respond with a 404, get the list of branches and see if we've got the sha/path wrong and try again. What do you think? |
|
I hadn’t considered that first problem, that’s a good spot. I agree with your solution. I’ll see what I can implement tonight (or maybe tomorrow) |
This pull request updates
github.jsto use the branches API to split the filepath from the branch path and use them both accordingly in calls to/contentsand/commits. This means we don't have to naively try and pull theshavariable from the path anymore.