Merge "Fix: Projects created outside of Gerrit could not be cloned."

This commit is contained in:
Edwin Kempin
2012-09-28 01:29:40 -07:00
committed by Gerrit Code Review

View File

@@ -136,7 +136,15 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager {
throw new RepositoryNotFoundException("Invalid name: " + name);
}
if (!names.contains(name)) {
throw new RepositoryNotFoundException(gitDirOf(name));
// The this.names list does not hold the project-name but it can still exist
// on disk; for instance when the project has been created directly on the
// file-system through replication.
//
if (FileKey.resolve(gitDirOf(name), FS.DETECTED) != null) {
onCreateProject(name);
} else {
throw new RepositoryNotFoundException(gitDirOf(name));
}
}
final FileKey loc = FileKey.lenient(gitDirOf(name), FS.DETECTED);
try {