]> source.dussan.org Git - gitblit.git/commitdiff
Fix fork detection on Windows
authorJames Moger <james.moger@gitblit.com>
Wed, 3 Oct 2012 21:07:22 +0000 (17:07 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 3 Oct 2012 21:07:22 +0000 (17:07 -0400)
src/com/gitblit/GitBlit.java
src/com/gitblit/models/RepositoryModel.java

index 1ebc4c70b598825be957a7a553f1b888cfce7f73..634896435e86cf6a2515da6f638b779a24d0d316 100644 (file)
@@ -1270,6 +1270,9 @@ public class GitBlit implements ServletContextListener {
                                        Constants.CONFIG_GITBLIT, null, "federationSets")));\r
                        model.isFederated = getConfig(config, "isFederated", false);\r
                        model.origin = config.getString("remote", "origin", "url");\r
+                       if (model.origin != null) {\r
+                               model.origin = model.origin.replace('\\', '/');\r
+                       }\r
                        model.preReceiveScripts = new ArrayList<String>(Arrays.asList(config.getStringList(\r
                                        Constants.CONFIG_GITBLIT, null, "preReceiveScript")));\r
                        model.postReceiveScripts = new ArrayList<String>(Arrays.asList(config.getStringList(\r
index a28536d1d70ead6eb612f5475ec5a72930ef1b18..65629fafbb36b4be816825110389d9492d5f6498 100644 (file)
@@ -148,6 +148,10 @@ public class RepositoryModel implements Serializable, Comparable<RepositoryModel
                return StringUtils.compareRepositoryNames(name, o.name);\r
        }\r
        \r
+       public boolean isFork() {\r
+               return !StringUtils.isEmpty(originRepository);\r
+       }\r
+       \r
        public boolean isPersonalRepository() {\r
                return !StringUtils.isEmpty(projectPath) && projectPath.charAt(0) == '~';\r
        }\r