Skip to content

Commit da5451d

Browse files
committed
Merge pull request #387 from Cheater912/master
Fix recursive trees + tests
2 parents 67f507f + 000cbbf commit da5451d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Github/Api/GitData/Trees.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Trees extends AbstractApi
2323
*/
2424
public function show($username, $repository, $sha, $recursive = false)
2525
{
26-
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/trees/'.rawurlencode($sha), array('recursive' => $recursive ? 1 : null));
26+
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/trees/'.rawurlencode($sha), $recursive ? array('recursive' => 1) : array());
2727
}
2828

2929
/**

test/Github/Tests/Api/GitData/TreesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function shouldShowTreeUsingSha()
1414
$api = $this->getApiMock();
1515
$api->expects($this->once())
1616
->method('get')
17-
->with('repos/KnpLabs/php-github-api/git/trees/123', array('recursive' => null))
17+
->with('repos/KnpLabs/php-github-api/git/trees/123', array())
1818
->will($this->returnValue($expectedValue));
1919

2020
$this->assertEquals($expectedValue, $api->show('KnpLabs', 'php-github-api', 123));

0 commit comments

Comments
 (0)