void (@NotNull Collection<? extends VcsRoot> vcsRoots) { Collection<VirtualFile> roots = vcsRoots.stream(). filter(root -> { AbstractVcs vcs = root.getVcs(); return vcs != null && vcs.getName().equals(myVcs.getName()); }). map(VcsRoot::getPath).collect(toList()); VirtualFile directoryToInitVcs = myTargetDirectory != null ? myTargetDirectory : ProjectUtil.guessProjectDir(myProject); assert directoryToInitVcs != null : "Base dir is unexpectedly null for project: " + myProject; if (roots.isEmpty()) { boolean succeeded = initOrNotifyError(directoryToInitVcs); if (succeeded) { addVcsRoots(Collections.singleton(directoryToInitVcs)); } } else { if (roots.size() > 1 || isProjectBelowVcs(roots)) { notifyAddedRoots(roots); } addVcsRoots(roots); } }