-
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
Add support to get raw file content as byte[] #2151
Conversation
42305ec
to
a1d690b
Compare
Codecov Report
@@ Coverage Diff @@
## master #2151 +/- ##
==========================================
- Coverage 65.89% 65.86% -0.03%
==========================================
Files 546 546
Lines 14251 14293 +42
Branches 836 838 +2
==========================================
+ Hits 9390 9414 +24
- Misses 4703 4720 +17
- Partials 158 159 +1
|
This allows to spare a little over 100ms in my tests on small files vs using the `GetAllContentsByRef` API. Fixes octokit#1651
@shiftkey I just rebased onto master. Do you think you'll get some time to review this pull request sooner or later? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @0xced - I merged in the latest changes to ensure this is all working as expected, and tidied up some unnecessary changes rather than hold this up.
@@ -2363,7 +2363,7 @@ public static Uri RepositoryArchiveLink(string owner, string name, ArchiveFormat | |||
/// <returns>The <see cref="Uri"/> for getting the contents of the specified repository and path</returns> | |||
public static Uri RepositoryContent(string owner, string name, string path, string reference) | |||
{ | |||
return "repos/{0}/{1}/contents/{2}?ref={3}".FormatUri(owner, name, path, reference); | |||
return "repos/{0}/{1}/contents/{2}?ref={3}".FormatUri(owner, name, path == "/" ? "" : path, reference); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice bit of cleanup for my more explicit example above - thanks!
release_notes: added |
Thanks for merging and releasing version 0.47.0! 🎉 |
This allows to spare a little over 100ms in my tests on small files vs using the
GetAllContentsByRef
API.Fixes #1651