Skip to content

Commit

Permalink
fix: use pagination when retrieving all branches of a repo
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Apr 9, 2024
1 parent d9eeeec commit c791105
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@

- Use scoped commands for interaction via pull requests. ([#211](https://github.com/eclipse-csi/otterdog/issues/211))

### Fixed

- Use pagination when retrieving all branches of a repository.


## [0.5.0] - 05/03/2024

Note: this version includes lots of additions and changes related to the GitHub App mode which are not
Expand Down
2 changes: 1 addition & 1 deletion otterdog/providers/github/rest/repo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ async def get_branches(self, org_id: str, repo_name) -> list[dict[str, Any]]:
print_debug(f"retrieving branches for repo '{org_id}/{repo_name}'")

try:
return await self.requester.request_json("GET", f"/repos/{org_id}/{repo_name}/branches")
return await self.requester.request_paged_json("GET", f"/repos/{org_id}/{repo_name}/branches")
except GitHubException as ex:
tb = ex.__traceback__
raise RuntimeError(f"failed getting branches for repo '{org_id}/{repo_name}':\n{ex}").with_traceback(tb)
Expand Down

0 comments on commit c791105

Please sign in to comment.