Skip to content

Commit f68c285

Browse files
committed
Updated commit parents
1 parent c073674 commit f68c285

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/commit.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,19 @@ Commit.prototype.history = function() {
208208
};
209209

210210
/**
211-
* Retrieve the commit's parent at the given position asynchronously.
211+
* Retrieve the commit's parents.
212212
*
213-
* @param {Integer} position
213+
* @param {Function} callback
214214
*/
215-
Commit.prototype.parent = function(position, callback) {
216-
self.rawCommit.parent(position, function processParent(error, rawParent) {
215+
Commit.prototype.parents = function(callback) {
216+
var self = this;
217+
self.rawCommit.parents(function processParent(error, rawParents) {
217218
if (success(error, callback)) {
218-
callback(null, new Commit(this.rawRepo, rawParent));
219+
var parents = [];
220+
rawParents.forEach(function eachParent(rawParent) {
221+
parents.push(new Commit(self.rawRepo, rawParent));
222+
});
223+
callback(null, parents);
219224
}
220225
});
221226
};

0 commit comments

Comments
 (0)