     # to either a {Repository} or null. Ideally, the {Directory} would be used
     # as the key; however, there can be multiple {Directory} objects created for
     # the same real path, so it is not a good key.
-    @repositoryPromisesByDirectory = new Map();
+    @repositoryPromisesByPath = new Map();
 
     # Note that the GitRepositoryProvider is registered synchronously so that
     # it is available immediately on startup.

          repo = repos[0] or null

          # If no repository is found, remove the entry in for the directory in
          # @repositoryPromisesByDirectory in case some other RepositoryProvider is
          # registered in the future that could supply a Repository for the
          # directory.
          if repo is null
            @repositoryPromisesByDirectory.delete path
          repo
      @repositoryPromisesByDirectory.set(path, promise)
    promise

  ###

  # * `null` if no repository can be created for the given directory.
  repositoryForDirectory: (directory) ->
    path = directory.getRealPathSync()
    promise = @repositoryPromisesByPath.get(path)
    unless promise
      promises = @repositoryProviders.map (provider) ->
          provider.repositoryForDirectory directory
