diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsRootChecker.java b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsRootChecker.java index 23a965b2549b..930edfd06f00 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsRootChecker.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsRootChecker.java @@ -36,13 +36,6 @@ public abstract class VcsRootChecker { return false; } - /** - * Checks if the given directory is a root of the supported VCS. - */ - public boolean isRoot(@NotNull VirtualFile maybeRoot) { - return isRoot(maybeRoot.getPath()); - } - /** * Returns the VCS supported by this checker. */ diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java index 6b83d7a6146d..fc4b1a6ec7fe 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootDetectorImpl.java @@ -143,8 +143,9 @@ public class VcsRootDetectorImpl implements VcsRootDetector { @Nullable private AbstractVcs getVcsFor(@NotNull VirtualFile maybeRoot, @Nullable VirtualFile dirToCheckForIgnore) { + String path = maybeRoot.getPath(); for (VcsRootChecker checker : myCheckers) { - if (checker.isRoot(maybeRoot) && (dirToCheckForIgnore == null || !checker.isIgnored(maybeRoot, dirToCheckForIgnore))) { + if (checker.isRoot(path) && (dirToCheckForIgnore == null || !checker.isIgnored(maybeRoot, dirToCheckForIgnore))) { return myVcsManager.findVcsByName(checker.getSupportedVcs().getName()); } } diff --git a/plugins/git4idea/src/git4idea/roots/GitRootChecker.java b/plugins/git4idea/src/git4idea/roots/GitRootChecker.java index 8f91dac7c68d..5d40640511d1 100644 --- a/plugins/git4idea/src/git4idea/roots/GitRootChecker.java +++ b/plugins/git4idea/src/git4idea/roots/GitRootChecker.java @@ -39,11 +39,6 @@ public class GitRootChecker extends VcsRootChecker { return GitUtil.isGitRoot(path); } - @Override - public boolean isRoot(@NotNull VirtualFile maybeRoot) { - return GitUtil.findGitDir(maybeRoot) != null; - } - @Override @NotNull public VcsKey getSupportedVcs() { diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/roots/HgRootChecker.java b/plugins/hg4idea/src/org/zmlx/hg4idea/roots/HgRootChecker.java index fb2143d01c4d..887568a6a15d 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/roots/HgRootChecker.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/roots/HgRootChecker.java @@ -17,8 +17,6 @@ package org.zmlx.hg4idea.roots; import com.intellij.openapi.vcs.VcsKey; import com.intellij.openapi.vcs.VcsRootChecker; -import com.intellij.openapi.vfs.VfsUtil; -import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.zmlx.hg4idea.HgVcs; import org.zmlx.hg4idea.util.HgUtil; @@ -35,11 +33,6 @@ public class HgRootChecker extends VcsRootChecker { return new File(path, HgUtil.DOT_HG).exists(); } - @Override - public boolean isRoot(@NotNull VirtualFile maybeRoot) { - return VfsUtil.refreshAndFindChild(maybeRoot, HgUtil.DOT_HG) != null; - } - @NotNull @Override public VcsKey getSupportedVcs() {