From 30fcf729302fc6f9db2f7e344e4a1765736582e6 Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Tue, 15 May 2018 11:48:27 -0400 Subject: [PATCH] Fix commit ordering and traversal for logWalk --- mixins/walkers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mixins/walkers.js b/mixins/walkers.js index 59a5475..1bb515a 100644 --- a/mixins/walkers.js +++ b/mixins/walkers.js @@ -39,6 +39,7 @@ function logWalk(ref, callback) { return repo.loadAs("commit", hash, function (err, commit) { if (!commit) return callback(err || new Error("Missing commit " + hash)); commit.hash = hash; + seen[hash] = true; if (hash === last) commit.last = true; return callback(null, commit); }); @@ -47,7 +48,7 @@ function logWalk(ref, callback) { } function compare(commit, other) { - return commit.author.date < other.author.date; + return commit.author.date.seconds > other.author.date.seconds; } function treeWalk(hash, callback) {