James Moger
2012-12-21 7b0f3069ec3011650c9628b6e17c01d5e845ca46
Added case-sensitive check for repository
2 files modified
15 ■■■■ changed files
src/com/gitblit/GitBlit.java 13 ●●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/RepositoryPage.java 2 ●●● patch | view | raw | blame | history
src/com/gitblit/GitBlit.java
@@ -1652,7 +1652,18 @@
     * @return true if the repository exists
     */
    public boolean hasRepository(String repositoryName) {
        if (settings.getBoolean(Keys.git.cacheRepositoryList, true)) {
        return hasRepository(repositoryName, false);
    }
    /**
     * Determines if this server has the requested repository.
     *
     * @param name
     * @param caseInsensitive
     * @return true if the repository exists
     */
    public boolean hasRepository(String repositoryName, boolean caseSensitiveCheck) {
        if (!caseSensitiveCheck && settings.getBoolean(Keys.git.cacheRepositoryList, true)) {
            // if we are caching use the cache to determine availability
            // otherwise we end up adding a phantom repository to the cache
            return repositoryListCache.containsKey(repositoryName.toLowerCase());
src/com/gitblit/wicket/pages/RepositoryPage.java
@@ -326,7 +326,7 @@
            RepositoryModel model = GitBlit.self().getRepositoryModel(
                    GitBlitWebSession.get().getUser(), repositoryName);
            if (model == null) {
                if (GitBlit.self().hasRepository(repositoryName)) {
                if (GitBlit.self().hasRepository(repositoryName, true)) {
                    // has repository, but unauthorized
                    authenticationError(getString("gb.unauthorizedAccessForRepository") + " " + repositoryName);
                } else {