From 9cc56a1f60eff2ce1db40b7078eab92e78602e1c Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sun, 13 Jan 2013 16:49:37 -0500
Subject: [PATCH] Fix submodule links on commit, comitdiff, and tree page (issue-178)

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

diff --git a/groovy/sendmail-html.groovy b/groovy/sendmail-html.groovy
index e0cdecd..1692073 100644
--- a/groovy/sendmail-html.groovy
+++ b/groovy/sendmail-html.groovy
@@ -370,14 +370,15 @@
         formatter.setDiffComparator(RawTextComparator.DEFAULT);
 
         def diffs
-        RevWalk rw = new RevWalk(repository);
+		RevWalk rw = new RevWalk(repository)
         if (commit.parentCount > 0) {
-            RevCommit parent = commit.parents[0]
+			RevCommit parent = rw.parseCommit(commit.parents[0].id)
             diffs = formatter.scan(parent.tree, commit.tree)
         } else {
             diffs = formatter.scan(new EmptyTreeIterator(),
                                    new CanonicalTreeParser(null, rw.objectReader, commit.tree))
         }
+		rw.dispose()
         // Write status table
         builder.table('class':"plain") {
             tbody() {

--
Gitblit v1.9.1