Skip to content

Commit e6229c0

Browse files
committed
Fix call for README file in repository.
1 parent b5b482f commit e6229c0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Github/Api/Repository/Contents.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class Contents extends AbstractApi
2323
*/
2424
public function readme($username, $repository, $reference = null)
2525
{
26-
return $this->show($username, $repository, 'readme', $reference);
26+
return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/readme', array(
27+
'ref' => $reference
28+
));
2729
}
2830

2931
/**

test/Github/Tests/Api/Repository/ContentsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function shouldShowReadme()
3737
$api = $this->getApiMock();
3838
$api->expects($this->once())
3939
->method('get')
40-
->with('repos/KnpLabs/php-github-api/contents/readme', array('ref' => null))
40+
->with('repos/KnpLabs/php-github-api/readme', array('ref' => null))
4141
->will($this->returnValue($expectedValue));
4242

4343
$this->assertEquals($expectedValue, $api->readme('KnpLabs', 'php-github-api'));

0 commit comments

Comments
 (0)