[git] IDEA-89552 Scary error message on 'Enable VCS integration' if executable is...
[idea/community.git] / plugins / git4idea / src / git4idea / roots / GitIntegrationEnabler.java
index f602ca2175dec9bdf2e71ab9021c6dc53687096f..16e3282fba0dd03bff69cb8364cb3b004e78f7a8 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.vcs.ProjectLevelVcsManager;
 import com.intellij.openapi.vcs.VcsDirectoryMapping;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.util.ui.UIUtil;
+import git4idea.GitVcs;
 import git4idea.Notificator;
 import git4idea.PlatformFacade;
 import git4idea.commands.Git;
@@ -83,8 +84,10 @@ public class GitIntegrationEnabler {
       return true;
     }
     else {
-      notificator.notifyError("Couldn't git init " + projectDir.getPresentableUrl(), result.getErrorOutputAsHtmlString());
-      LOG.info(result.getErrorOutputAsHtmlString());
+      if (((GitVcs)myPlatformFacade.getVcs(myProject)).getExecutableValidator().checkExecutableAndNotifyIfNeeded()) {
+        notificator.notifyError("Couldn't git init " + projectDir.getPresentableUrl(), result.getErrorOutputAsHtmlString());
+        LOG.info(result.getErrorOutputAsHtmlString());
+      }
       return false;
     }
   }