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

The commit:

  cd94b4b7a381527f9bd216ffc7b7b3180075d16f
  "Fix case check for project name so that symlinks work again"

...introduced an issue where projects created directly on FS
could not be cloned. Effectively rendering new and replicated
projects unreachable from gerrit slaves before flushing the
projects_list cache and rescanning the filesystem through ssh
command "ls-project".

A new check is introduced in this patch, allowing projects to
be read from FS if they are not found in the names-cache.

Change-Id: Iab33b4480179792c1f151e53fc8d037721f01264
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java
index cfb2d57..4e3f324 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/LocalDiskRepositoryManager.java
@@ -136,7 +136,15 @@
       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 {