From ff148dd3af7afa81736c0f8600912fa88099a6b9 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sun, 01 Jan 2012 13:32:37 -0500
Subject: [PATCH] Added unit test for blockpush.groovy

---
 groovy/sendmail.groovy |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/groovy/sendmail.groovy b/groovy/sendmail.groovy
index 5733ae7..9616909 100644
--- a/groovy/sendmail.groovy
+++ b/groovy/sendmail.groovy
@@ -130,7 +130,7 @@
 		
 	switch (command.type) {
 		case ReceiveCommand.Type.CREATE:
-			def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name)
+			def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name).reverse()
 			commitCount += commits.size()
 			if (commits.size() > 0) {
 				// new branch
@@ -146,7 +146,7 @@
 			}
 			break
 		case ReceiveCommand.Type.UPDATE:
-			def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name)
+			def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name).reverse()
 			commitCount += commits.size()
 			// fast-forward branch commits table
 			changes += "$branchBreak $ref branch updated ($commits.size commits)\n$branchBreak"
@@ -154,7 +154,7 @@
 			changes += '\n'
 			break
 		case ReceiveCommand.Type.UPDATE_NONFASTFORWARD:
-			def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name)
+			def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name).reverse()
 			commitCount += commits.size()
 			// non-fast-forward branch commits table
 			changes += "$branchBreak $ref branch updated [NON fast-forward] ($commits.size commits)\n$branchBreak"

--
Gitblit v1.9.1