@@ -21,17 +21,12 @@ Commit.lookup = LookupWrapper(Commit);
2121 * @param {Number } n
2222 * @return {Commit }
2323 */
24- Commit . prototype . parent = function ( n , callback ) {
24+ Commit . prototype . parent = function ( n ) {
2525 var repo = this . repo ;
2626 return _parent . call ( this , n ) . then ( p => {
2727 p . repo = repo ;
28-
29- if ( typeof callback === "function" ) {
30- callback ( null , p ) ;
31- }
32-
3328 return p ;
34- } , callback ) ;
29+ } ) ;
3530} ;
3631
3732/**
@@ -43,10 +38,10 @@ Commit.prototype.parent = function(n, callback) {
4338 * @param {String } message_encoding
4439 * @param {String } message
4540 * @param {Tree|Oid } tree
46- * @param {Oid } callback
41+ * @return {Oid }
4742 */
4843Commit . prototype . amend = function (
49- updateRef , author , committer , message_encoding , message , tree , callback ) {
44+ updateRef , author , committer , message_encoding , message , tree ) {
5045 var repo = this . repo ;
5146 var _this = this ;
5247 var treePromise ;
@@ -244,11 +239,10 @@ Commit.prototype.date = function() {
244239 * and its parent(s).
245240 *
246241 * @async
247- * @param {Function } callback
248242 * @return {Array<Diff> } an array of diffs
249243 */
250- Commit . prototype . getDiff = function ( callback ) {
251- return this . getDiffWithOptions ( null , callback ) ;
244+ Commit . prototype . getDiff = function ( ) {
245+ return this . getDiffWithOptions ( null ) ;
252246} ;
253247
254248/**
@@ -257,10 +251,9 @@ Commit.prototype.getDiff = function(callback) {
257251 *
258252 * @async
259253 * @param {Object } options
260- * @param {Function } callback
261254 * @return {Array<Diff> } an array of diffs
262255 */
263- Commit . prototype . getDiffWithOptions = function ( options , callback ) {
256+ Commit . prototype . getDiffWithOptions = function ( options ) {
264257 var commit = this ;
265258
266259 return commit . getTree ( ) . then ( function ( thisTree ) {
@@ -278,13 +271,7 @@ Commit.prototype.getDiffWithOptions = function(options, callback) {
278271
279272 return Promise . all ( diffs ) ;
280273 } ) ;
281- } ) . then ( function ( diffs ) {
282- if ( typeof callback === "function" ) {
283- callback ( null , diffs ) ;
284- }
285-
286- return diffs ;
287- } , callback ) ;
274+ } ) ;
288275} ;
289276
290277/**
@@ -295,34 +282,22 @@ Commit.prototype.getDiffWithOptions = function(options, callback) {
295282 * @param {String } path
296283 * @return {TreeEntry }
297284 */
298- Commit . prototype . getEntry = function ( path , callback ) {
285+ Commit . prototype . getEntry = function ( path ) {
299286 return this . getTree ( ) . then ( function ( tree ) {
300- return tree . getEntry ( path ) . then ( function ( entry ) {
301- if ( typeof callback === "function" ) {
302- callback ( null , entry ) ;
303- }
304-
305- return entry ;
306- } ) ;
307- } , callback ) ;
287+ return tree . getEntry ( path ) ;
288+ } ) ;
308289} ;
309290
310291/**
311292 * Retrieve the commit's parents as commit objects.
312293 *
313294 * @async
314295 * @param {number } limit Optional amount of parents to return.
315- * @param {Function } callback
316296 * @return {Array<Commit> } array of commits
317297 */
318- Commit . prototype . getParents = function ( limit , callback ) {
298+ Commit . prototype . getParents = function ( limit ) {
319299 var parents = [ ] ;
320300
321- // Shift arguments.
322- if ( typeof limit === "function" ) {
323- callback = limit ;
324- }
325-
326301 // If no limit was set, default to the maximum parents.
327302 limit = typeof limit === "number" ? limit : this . parentcount ( ) ;
328303 limit = Math . min ( limit , this . parentcount ( ) ) ;
@@ -335,13 +310,7 @@ Commit.prototype.getParents = function(limit, callback) {
335310 }
336311
337312 // Wait for all parents to complete, before returning.
338- return Promise . all ( parents ) . then ( function ( parents ) {
339- if ( typeof callback === "function" ) {
340- callback ( null , parents ) ;
341- }
342-
343- return parents ;
344- } , callback ) ;
313+ return Promise . all ( parents ) ;
345314} ;
346315
347316/**
@@ -367,8 +336,8 @@ Commit.prototype.getSignature = function(field) {
367336 * @async
368337 * @return {Tree }
369338 */
370- Commit . prototype . getTree = function ( callback ) {
371- return this . repo . getTree ( this . treeId ( ) , callback ) ;
339+ Commit . prototype . getTree = function ( ) {
340+ return this . repo . getTree ( this . treeId ( ) ) ;
372341} ;
373342
374343/**
@@ -415,7 +384,7 @@ Commit.prototype.history = function() {
415384
416385/**
417386 * Get the specified parent of the commit.
418- *
387+ *
419388 * @param {number } the position of the parent, starting from 0
420389 * @async
421390 * @return {Commit } the parent commit at the specified position
0 commit comments