Skip to content

Commit d6fae86

Browse files
committed
Fixed way to get repository content of root folder
1 parent a0f57b0 commit d6fae86

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/Github/Api/Repository/Contents.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ public function readme($username, $repository, $reference = null)
1616
return $this->show($username, $repository, 'readme', $reference);
1717
}
1818

19-
public function show($username, $repository, $path, $reference = null)
19+
public function show($username, $repository, $path = null, $reference = null)
2020
{
21-
return $this->get('repos/'.urlencode($username).'/'.urlencode($repository).'/contents/'.urlencode($path), array(
21+
$url = 'repos/'.urlencode($username).'/'.urlencode($repository).'/contents';
22+
if (null !== $path) {
23+
$url .= '/'.urlencode($path);
24+
}
25+
26+
return $this->get($url, array(
2227
'ref' => $reference
2328
));
2429
}

0 commit comments

Comments
 (0)