From 543702f855bb67b172af0e6f4d01ce28203b11bc Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Fri, 15 Mar 2013 15:28:28 +0400 Subject: [PATCH] [git] Don't scan for roots in tests --- plugins/git4idea/src/git4idea/roots/GitRootScanner.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/git4idea/src/git4idea/roots/GitRootScanner.java b/plugins/git4idea/src/git4idea/roots/GitRootScanner.java index 226f8932b603..c14f276a4c22 100644 --- a/plugins/git4idea/src/git4idea/roots/GitRootScanner.java +++ b/plugins/git4idea/src/git4idea/roots/GitRootScanner.java @@ -17,6 +17,7 @@ package git4idea.roots; import com.intellij.ProjectTopics; import com.intellij.openapi.Disposable; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.DumbAwareRunnable; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ModuleRootEvent; @@ -111,6 +112,11 @@ public class GitRootScanner implements BulkFileListener, ModuleRootListener, Dis } private void scheduleScan() { + if (ApplicationManager.getApplication().isUnitTestMode()) { + // don't scan in tests + return; + } + myAlarm.cancelAllRequests(); // one scan is enough, no need to queue, they all do the same myAlarm.addRequest(new Runnable() { @Override