]> source.dussan.org Git - gitblit.git/commitdiff
Fix support for implied SSH urls in web.otherUrls (issue-311)
authorJames Moger <james.moger@gitblit.com>
Thu, 19 Sep 2013 13:03:04 +0000 (09:03 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 19 Sep 2013 13:03:04 +0000 (09:03 -0400)
releases.moxie
src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java

index b05fbc1b773cd9dec6ae024cf9259124e6b0e278..23c0de8b3f04e5837e3420d924de223f46bad16a 100644 (file)
@@ -10,6 +10,7 @@ r20: {
     text: ~
     security: ~
     fixes:
+       - Fixed support for implied SSH urls in web.otherUrls (issue-311)
        - Fix potential NPE on removing uncached repository from cache
        - Ignore the default contents of .git/description file
     changes:
@@ -32,6 +33,8 @@ r20: {
        - Klaus Nuber
        - Florian Zschocke
        - Bret Ikehara
+       - Chad Horohoe
+       - Domingo Oropeza
 }
 
 #
index aaab2b1cbc5290cea05f98033207a99757b26832..0dae3cf193be0a76ebf7f81636832882d4db89f1 100644 (file)
@@ -365,7 +365,15 @@ public class RepositoryUrlPanel extends BasePanel {
                if (!urlPermissionsMap.containsKey(repoUrl.url)) {\r
                        String note;\r
                        if (repoUrl.isExternal()) {\r
-                               String protocol = repoUrl.url.substring(0, repoUrl.url.indexOf("://"));\r
+                               String protocol;\r
+                               int protocolIndex = repoUrl.url.indexOf("://");\r
+                               if (protocolIndex > -1) {\r
+                                       // explicit protocol specified\r
+                                       protocol = repoUrl.url.substring(0, protocolIndex);\r
+                               } else {\r
+                                       // implicit SSH url\r
+                                       protocol = "ssh";\r
+                               }\r
                                note = MessageFormat.format(getString("gb.externalPermissions"), protocol);                     \r
                        } else {\r
                                note = null;                    \r