1- var git = require ( "../" ) ;
2- var util = require ( "./util" ) ;
3- var Revwalk = git . Revwalk ;
1+ var NodeGit = require ( "../" ) ;
2+ var normalizeOid = require ( "./util/normalize_oid" ) ;
3+
4+ var Revwalk = NodeGit . Revwalk ;
45
56// Backwards compatibility.
6- Object . defineProperty ( git , "RevWalk" , {
7+ Object . defineProperty ( NodeGit , "RevWalk" , {
78 value : Revwalk ,
89 enumerable : false
910} ) ;
1011
1112var oldSorting = Revwalk . prototype . sorting ;
1213
1314/**
14- * Refer to vendor/libgit2 /include/git2 /revwalk.h for sort definitions.
15+ * Refer to vendor/libNodeGit2 /include/NodeGit2 /revwalk.h for sort definitions.
1516 */
1617Revwalk . Sort = {
1718 None : 0 ,
@@ -22,7 +23,7 @@ Revwalk.Sort = {
2223
2324/**
2425 * Set the sort order for the revwalk. This function takes variable arguments
25- * like `revwalk.sorting(git .RevWalk.Topological, git .RevWalk.Reverse).`
26+ * like `revwalk.sorting(NodeGit .RevWalk.Topological, NodeGit .RevWalk.Reverse).`
2627 *
2728 * @param {Number } sort
2829 */
@@ -45,6 +46,8 @@ Revwalk.prototype.sorting = function() {
4546 * @return {Commit }
4647 */
4748Revwalk . prototype . walk = function ( oid , callback ) {
49+ oid = normalizeOid ( oid ) ;
50+
4851 var self = this ;
4952
5053 this . push ( oid ) ;
@@ -73,7 +76,4 @@ Revwalk.prototype.walk = function(oid, callback) {
7376 walk ( ) ;
7477} ;
7578
76- util . normalizeOid ( Revwalk . prototype , "walk" ) ;
77- util . makeSafe ( Revwalk . prototype , "walk" ) ;
78-
7979module . exports = Revwalk ;
0 commit comments