From ed63fb6b5ba2936614c985b80515603d990fa42a Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Sat, 12 Feb 2022 21:09:16 +0000 Subject: [PATCH] Include optional params parameter for Commits compare With the current API, we cannot paginate compare basehead function call. The Github API limits the response to only 250 commits so for larger diffs we have no option. --- lib/Github/Api/Repository/Commits.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Github/Api/Repository/Commits.php b/lib/Github/Api/Repository/Commits.php index 8195e4baf0f..383905d28f2 100644 --- a/lib/Github/Api/Repository/Commits.php +++ b/lib/Github/Api/Repository/Commits.php @@ -16,14 +16,14 @@ public function all($username, $repository, array $params) return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits', $params); } - public function compare($username, $repository, $base, $head, $mediaType = null) + public function compare($username, $repository, $base, $head, $mediaType = null, array $params = []) { $headers = []; if (null !== $mediaType) { $headers['Accept'] = $mediaType; } - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), [], $headers); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), $params, $headers); } public function show($username, $repository, $sha)