(fix) RepositoryContentsClient.GetArchive does not return the expected binary content#2803
Merged
kfcampbell merged 6 commits intooctokit:mainfrom Oct 16, 2023
Jericho:getarchive
Merged
(fix) RepositoryContentsClient.GetArchive does not return the expected binary content#2803kfcampbell merged 6 commits intooctokit:mainfrom Jericho:getarchive
kfcampbell merged 6 commits intooctokit:mainfrom
Jericho:getarchive
Conversation
This unit test currently fails which demonstrates the problem and it should pass when I am done with the PR
I debated adding an optional parameter for the timeout to the existing GetRaw method (which would be my personal preference) but it would be a breaking change and I doubt the Octokit team would be interested in such a change
… repo's archive content. This ensure stream content are handled properly and solves the problem described in GitHub issue 2802
…he GetArchive method
kfcampbell
approved these changes
Oct 16, 2023
Contributor
kfcampbell
left a comment
There was a problem hiding this comment.
I'm comfortable with the decision to overload here.
Lulalaby
referenced
this pull request
in Fortunevale/ProjectMakoto
Nov 1, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [Octokit](https://togithub.com/octokit/octokit.net) | `8.1.1` -> `9.0.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>octokit/octokit.net (Octokit)</summary> ### [`v9.0.0`](https://togithub.com/octokit/octokit.net/releases/tag/v9.0.0) ##### What's Changed ##### Breaking changes - Removes the .NET 5.0 support by [@​nickfloyd](https://togithub.com/nickfloyd) in [https://github.com/octokit/octokit.net/pull/2806](https://togithub.com/octokit/octokit.net/pull/2806) ##### Features - \[feat]: Add RenameBranch method to RepositoryBranchesClient by [@​dirtygooback](https://togithub.com/dirtygooback) in [https://github.com/octokit/octokit.net/pull/2799](https://togithub.com/octokit/octokit.net/pull/2799) ##### Fixes - (fix) RepositoryContentsClient.GetArchive does not return the expected binary content by [@​Jericho](https://togithub.com/Jericho) in [https://github.com/octokit/octokit.net/pull/2803](https://togithub.com/octokit/octokit.net/pull/2803) ##### Maintenance - build(deps): bump xunit.runner.visualstudio from 2.5.1 to 2.5.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/octokit/octokit.net/pull/2805](https://togithub.com/octokit/octokit.net/pull/2805) - build(deps): bump xunit from 2.5.1 to 2.5.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/octokit/octokit.net/pull/2804](https://togithub.com/octokit/octokit.net/pull/2804) ##### New Contributors - [@​Jericho](https://togithub.com/Jericho) made their first contribution in [https://github.com/octokit/octokit.net/pull/2803](https://togithub.com/octokit/octokit.net/pull/2803) **Full Changelog**: octokit/octokit.net@v8.1.1...v9.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Fortunevale/ProjectMakoto). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
This was referenced Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2802
Before the change?
RepositoryContentsClient.GetArchive expects the result of the API call to contain a byte[] when in fact a stream is returned. This bug is due to a change introduced here.
After the change?
RepositoryContentsClient.GetArchive invokes Connection.GetRaw rather than Connection.Get<byte[]> in order to be the binary content of the response.
Pull request checklist
Does this introduce a breaking change?
To ensure that I was not introducing a breaking change, I created an overload of the existing
GetRawmethod to accept a timeout parameter. I could have added an additional parameter to the existing GetRaw method, but that would have been a breaking change. If you prefer the "additional-parameter-to-existing-method" rather than "overload-existing-method", I'll be happy to modifiy my PR.