]> source.dussan.org Git - gitblit.git/commitdiff
Added case-sensitive check for repository
authorJames Moger <james.moger@gitblit.com>
Fri, 21 Dec 2012 22:14:24 +0000 (17:14 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 21 Dec 2012 22:14:24 +0000 (17:14 -0500)
src/com/gitblit/GitBlit.java
src/com/gitblit/wicket/pages/RepositoryPage.java

index 54ca6d2056eed36bd3f8a608b91d0e887014af40..076bb765a14b5dcaae92bacf186b0cd4c63bbab1 100644 (file)
@@ -1652,7 +1652,18 @@ public class GitBlit implements ServletContextListener {
         * @return true if the repository exists\r
         */\r
        public boolean hasRepository(String repositoryName) {\r
-               if (settings.getBoolean(Keys.git.cacheRepositoryList, true)) {\r
+               return hasRepository(repositoryName, false);\r
+       }\r
+       \r
+       /**\r
+        * Determines if this server has the requested repository.\r
+        * \r
+        * @param name\r
+        * @param caseInsensitive\r
+        * @return true if the repository exists\r
+        */\r
+       public boolean hasRepository(String repositoryName, boolean caseSensitiveCheck) {\r
+               if (!caseSensitiveCheck && settings.getBoolean(Keys.git.cacheRepositoryList, true)) {\r
                        // if we are caching use the cache to determine availability\r
                        // otherwise we end up adding a phantom repository to the cache\r
                        return repositoryListCache.containsKey(repositoryName.toLowerCase());\r
index 897e20013d3f6333fee69326b2b7a4d7e9106fe5..aac527d7c513f042830a4d493a3b8eb64f491eb8 100644 (file)
@@ -326,7 +326,7 @@ public abstract class RepositoryPage extends BasePage {
                        RepositoryModel model = GitBlit.self().getRepositoryModel(\r
                                        GitBlitWebSession.get().getUser(), repositoryName);\r
                        if (model == null) {\r
-                               if (GitBlit.self().hasRepository(repositoryName)) {\r
+                               if (GitBlit.self().hasRepository(repositoryName, true)) {\r
                                        // has repository, but unauthorized\r
                                        authenticationError(getString("gb.unauthorizedAccessForRepository") + " " + repositoryName);\r
                                } else {\r