[git] IDEA-89552 Scary error message on 'Enable VCS integration' if executable is...
authorKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Wed, 1 Aug 2012 11:32:10 +0000 (15:32 +0400)
committerKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Wed, 1 Aug 2012 11:32:40 +0000 (15:32 +0400)
Don't show the whole error if executable is not valid. Instead show the standard notification about the fact.

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;
     }
   }