Skip to content

Commit

Permalink
[nobug] Don't fetch the full parent commits for the JSON response
Browse files Browse the repository at this point in the history
As the SHA value of the commits is the only information that's needed
for the JSON, simply retrieve it via the commit object instead of
fetching full commit objects for the parents.

Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed May 16, 2017
1 parent aff9514 commit adfa35b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/orionode/lib/git/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,8 @@ function countCommit(revWalk){
}

function getCommitParents(repo, commit, fileDir) {
return commit.getParents()
.then(function(parents) {
return parents.map(function(parent) {
return createParentJSON(parent.sha(), fileDir);
});
return commit.parents().map(function(parent) {
return createParentJSON(parent.toString(), fileDir);
});
}

Expand Down

0 comments on commit adfa35b

Please sign in to comment.