]> source.dussan.org Git - gitblit.git/commitdiff
Fix project model creation bug with forced lowercase names 18/118/1
authorJames Moger <james.moger@gitblit.com>
Sat, 28 Jun 2014 03:30:04 +0000 (23:30 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 28 Jun 2014 03:30:04 +0000 (23:30 -0400)
src/main/java/com/gitblit/manager/ProjectManager.java

index b30f4f17be9eea70a323e107afe29d788bb87283..666f521043533cd7607d0913819a6a3ff46ac248 100644 (file)
@@ -178,19 +178,20 @@ public class ProjectManager implements IProjectManager {
                map.put("", configs.get(""));
 
                for (RepositoryModel model : repositoryManager.getRepositoryModels(user)) {
-                       String rootPath = StringUtils.getRootPath(model.name).toLowerCase();
-                       if (!map.containsKey(rootPath)) {
+                       String projectPath = StringUtils.getRootPath(model.name);
+                       String projectKey = projectPath.toLowerCase();
+                       if (!map.containsKey(projectKey)) {
                                ProjectModel project;
-                               if (configs.containsKey(rootPath)) {
+                               if (configs.containsKey(projectKey)) {
                                        // clone the project model because it's repository list will
                                        // be tailored for the requesting user
-                                       project = DeepCopier.copy(configs.get(rootPath));
+                                       project = DeepCopier.copy(configs.get(projectKey));
                                } else {
-                                       project = new ProjectModel(rootPath);
+                                       project = new ProjectModel(projectPath);
                                }
-                               map.put(rootPath, project);
+                               map.put(projectKey, project);
                        }
-                       map.get(rootPath).addRepository(model);
+                       map.get(projectKey).addRepository(model);
                }
 
                // sort projects, root project first