]> source.dussan.org Git - gitblit.git/commitdiff
Fixed submodule diff display
authorJames Moger <james.moger@gitblit.com>
Tue, 25 Jun 2013 11:59:07 +0000 (07:59 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 25 Jun 2013 11:59:07 +0000 (07:59 -0400)
releases.moxie
src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java

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