Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add recursive parameter in Repository.getTree
  • Loading branch information
aymen-mouelhi committed Apr 14, 2017
commit 7745abded1e3fe9a24f5bd875e40f18142c2abe4
2 changes: 1 addition & 1 deletion lib/Repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class Repository extends Requestable {
*/
getTree(treeSHA, recursive, cb) {
recursive = recursive ? '?recursive=true' : '';
return this._request('GET', `/repos/${this.__fullname}/git/trees/${treeSHA}/${recursive}`, null, cb);
return this._request('GET', `/repos/${this.__fullname}/git/trees/${treeSHA}${recursive}`, null, cb);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/repository.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Repository', function() {
});

it('should get tree', function(done) {
remoteRepo.getTree('master', assertSuccessful(done, function(err, response) {
remoteRepo.getTree('master', true, assertSuccessful(done, function(err, response) {
let {tree} = response;
expect(tree).to.be.an.array();
expect(tree.length).to.be.above(0);
Expand Down