File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff 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} ;
You can’t perform that action at this time.
0 commit comments