Skip to content

Commit 0bdc25a

Browse files
authored
Merge pull request #215 from fbourigault/v4-api-9679
commits repository v4 api changes
2 parents fe8df7d + c2e2aa0 commit 0bdc25a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

UPGRADE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ See [documentation](doc/customize.md) to know how to customize the client timeou
1818
* The `keys`, `key`, `addKey`, `removeKey`, `disableKey` and `enableKey` methods have been removed.
1919
Use the `deployKeys`, `deployKey`, `addDeployKey`, `deleteDeployKey`, `removeDeployKey` and `enableDeployKey` instead.
2020

21+
## `Gitlab\Api\Repositories` changes
22+
23+
* The `commits` page argument now start from 1 instead of 0.
24+
2125
## `Gitlab\Model\Project` changes
2226

2327
* The `keys`, `key`, `addKey`, `removeKey`, `disableKey` and `enableKey` methods have been removed.

lib/Gitlab/Api/Repositories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function commitBuilds($project_id, $sha, $scope = null, $page = 0, $per_p
150150
* @param null $ref_name
151151
* @return mixed
152152
*/
153-
public function commits($project_id, $page = 0, $per_page = self::PER_PAGE, $ref_name = null)
153+
public function commits($project_id, $page = 1, $per_page = self::PER_PAGE, $ref_name = null)
154154
{
155155
return $this->get($this->getProjectPath($project_id, 'repository/commits'), array(
156156
'page' => $page,

test/Gitlab/Tests/Api/RepositoriesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function shouldGetCommits()
228228
$api = $this->getApiMock();
229229
$api->expects($this->once())
230230
->method('get')
231-
->with('projects/1/repository/commits', array('page' => 0, 'per_page' => AbstractApi::PER_PAGE, 'ref_name' => null))
231+
->with('projects/1/repository/commits', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE, 'ref_name' => null))
232232
->will($this->returnValue($expectedArray))
233233
;
234234

0 commit comments

Comments
 (0)