code: public static synchronized boolean existsInstance(File path) {
      String canonicalPath = "";
  
      try {
        canonicalPath = path.getCanonicalPath();
      } catch (IOException e) {
        //obviously, the answer is NO
        return false;
      }
  
      return INSTANCES.containsKey(canonicalPath);
    }
docs: Checks if there is a DotGit instance for a given path
  
  @param path
  <code>File</code> object representing the path to the repository.
  @return
  true if exits, false otherwise;