private boolean isRoot(@NotNull final VcsDirectoryMapping mapping) {
    if (mapping.isDefaultMapping()) return true;
    AbstractVcs vcs = myVcsManager.findVcsByName(mapping.getVcs());
    if (vcs == null) return false;

    VcsRootChecker rootChecker = myVcsManager.getRootChecker(vcs);
    VirtualFile directory = LocalFileSystem.getInstance().findFileByPath(mapping.getDirectory());
    return directory != null && rootChecker.validateRoot(directory);
  }
private boolean isRoot(@NotNull final VcsDirectoryMapping mapping)