git: do not request GitRepository by root only to check its root

GitOrigin-RevId: 27be245a1bf2df285f0708a89d1a4752205f643d
This commit is contained in:
Aleksey Pivovarov
2019-06-10 15:11:12 +03:00
committed by intellij-monorepo-bot
parent 4b49651361
commit 91f3430bbc
@@ -306,9 +306,6 @@ public class GitUntrackedFilesHolder implements Disposable, AsyncVfsEventsListen
}
private boolean belongsToThisRepository(VirtualFile file) {
// this check should be quick
// we shouldn't create a full instance repository here because it may lead to SOE while many unversioned files will be processed
GitRepository repository = myRepositoryManager.getRepositoryForRootQuick(myVcsManager.getVcsRootFor(file));
return repository != null && repository.getRoot().equals(myRoot);
return myRoot.equals(myVcsManager.getVcsRootFor(file));
}
}