Skip to content

Commit c8073db

Browse files
authored
Merge pull request #1 from thomx12/support_for_path_param
Added support for the path parameter to the commits endpoint
2 parents 461776a + 61e0239 commit c8073db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Gitlab/Api/Repositories.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function commits($project_id, array $parameters = [])
152152
return $value->format('c');
153153
};
154154

155+
$resolver->setDefined('path');
155156
$resolver->setDefined('ref_name');
156157
$resolver->setDefined('since')
157158
->setAllowedTypes('since', \DateTimeInterface::class)

test/Gitlab/Tests/Api/RepositoriesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ public function shouldGetCommitsWithParams()
250250
$api = $this->getApiMock();
251251
$api->expects($this->once())
252252
->method('get')
253-
->with('projects/1/repository/commits', array('page' => 2, 'per_page' => 25, 'ref_name' => 'master'))
253+
->with('projects/1/repository/commits', array('page' => 2, 'per_page' => 25, 'ref_name' => 'master', 'path' => 'file_path/file_name'))
254254
->will($this->returnValue($expectedArray))
255255
;
256256

257-
$this->assertEquals($expectedArray, $api->commits(1, ['page' => 2, 'per_page' => 25, 'ref_name' => 'master']));
257+
$this->assertEquals($expectedArray, $api->commits(1, ['page' => 2, 'per_page' => 25, 'ref_name' => 'master', 'path' => 'file_path/file_name']));
258258
}
259259

260260
/**

0 commit comments

Comments
 (0)