File tree Expand file tree Collapse file tree 1 file changed +11
-16
lines changed
Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var Commit = NodeGit.Commit;
44var LookupWrapper = NodeGit . Utils . lookupWrapper ;
55
66var _amend = Commit . prototype . amend ;
7+ var _parent = Commit . prototype . parent ;
78
89/**
910 * Retrieves the commit pointed to by the oid
@@ -19,24 +20,18 @@ Commit.lookup = LookupWrapper(Commit);
1920 * @param {Number } n
2021 * @return {Commit }
2122 */
22- Commit . prototype . parent = ( function ( parent ) {
23- if ( typeof parent !== "function" ) {
24- throw new Error ( "parent is not a function!" ) ;
25- }
26-
27- return function ( n , callback ) {
28- var repo = this . repo ;
29- return parent . call ( this , n ) . then ( p => {
30- p . repo = repo ;
23+ Commit . prototype . parent = function ( n , callback ) {
24+ var repo = this . repo ;
25+ return _parent . call ( this , n ) . then ( p => {
26+ p . repo = repo ;
3127
32- if ( typeof callback === "function" ) {
33- callback ( null , p ) ;
34- }
28+ if ( typeof callback === "function" ) {
29+ callback ( null , p ) ;
30+ }
3531
36- return p ;
37- } , callback ) ;
38- } ;
39- } ) ( Commit . prototype . parent ) ;
32+ return p ;
33+ } , callback ) ;
34+ } ;
4035
4136/**
4237 * Amend a commit
You can’t perform that action at this time.
0 commit comments