From 0a44f9b3546f778a5d25c93dde3560703660a206 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 25 Jun 2013 07:59:07 -0400
Subject: [PATCH] Fixed submodule diff display

---
 releases.moxie                                            |    3 ++-
 src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java |   12 ++++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/releases.moxie b/releases.moxie
index ba6951e..a8b2f4c 100644
--- a/releases.moxie
+++ b/releases.moxie
@@ -31,7 +31,8 @@
 	 - Disable SNI extensions for client SSL connections
 	 - Fixed prettify language extension loading
 	 - Fixed index out of bounds exceptions when generating client certificates for a user when the user's table has been filtered
-	 - Fixed AddindexedBranch tool when specifying the non-default branch. 
+	 - Fixed AddindexedBranch tool when specifying the non-default branch.
+	 - Fixed submodule diff display
 
 	changes:
 	 - Improved error logging for servlet containers which provide a null contextFolder (issue 199)
diff --git a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java
index f871e77..62966de 100644
--- a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java
+++ b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java
@@ -157,7 +157,19 @@
 				sb.append("<table><tbody>");
 				inFile = true;
 			} else {
+				boolean gitLinkDiff = line.length() > 0 && line.substring(1).startsWith("Subproject commit");
+				if (gitLinkDiff) {
+					sb.append("<tr><th></th><th></th>");
+					if (line.charAt(0) == '+') {
+						sb.append("<td><div class=\"diff add2\">");
+					} else {
+						sb.append("<td><div class=\"diff remove2\">");
+					}
+				}
 				sb.append(line);
+				if (gitLinkDiff) {
+					sb.append("</div></td></tr>");
+				}
 			}
 		}
 		sb.append("</table></div>");

--
Gitblit v1.9.1