Browse Source

Fix project model creation bug with forced lowercase names

tags/v1.6.1
James Moger 10 years ago
parent
commit
3983a12012
1 changed files with 8 additions and 7 deletions
  1. 8
    7
      src/main/java/com/gitblit/manager/ProjectManager.java

+ 8
- 7
src/main/java/com/gitblit/manager/ProjectManager.java View 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

Loading…
Cancel
Save