-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Repository contents apis don't handle the root tree properly #1837
Comments
Stepping into this, I've found that the URL that gets GET'd in the end is https://api.github.com/repositories/3234987/contents//?ref=d728a08b4288b8445b14444d2e5e330b735f4d17 Notice the double slash? In the end this ends up redirecting back to https://api.github.com/repositories/3234987/contents giving me the slightly different results |
Ok, so changing dir from
(Same line on master) Allowed the request to run as expected Solution would be to one or both of the following: a) Properly handle "/" passed as a path to the repo content apis |
Hey @Cyberboss This is ringing a bell... need to look through old issues to see if I can find it. |
OK yeah, so that answer is that an overload already exists that has no octokit.net/Octokit/Clients/RepositoryContentsClient.cs Lines 154 to 163 in ef1994d
Previously an issue and PR #1688 & #1689 were raised to "fix" this, but were closed when they realised there was an overload that allowed this already. As I commented there though, I would be happy to allow empty string on the |
Just ran into this as well. Either use the overload that doesn't take the path, or substitute a dot ( In fact, the API supports a named parameter (path) so it can be explicitly stated rather than using the position (?path=/&ref=) so the best of all worlds would be to make this patch:
|
I believe this was related to I had a failing test submitted in #1956 that covered this API, so I took that to fix the issue in #2105 which shipped in I believe this has been resolved but please let me know if you still see it, and the code sample used to reproduce the problem on our end. |
Take a look at this tree:
https://github.com/tgstation/tgstation/tree/d728a08b4288b8445b14444d2e5e330b735f4d17
https://api.github.com/repos/tgstation/tgstation/contents/?ref=d728a08b4288b8445b14444d2e5e330b735f4d17
27 entries right?
However, if you retrieve it with octokit.net...
For some odd reason, suits.dmi will NOT be retrieved.
Note that this is running off commit a1d3c7a
Master latest commit: 3345f76
The text was updated successfully, but these errors were encountered: