From 9f3d0e8ac113452da2ef37ba8122f7a67ea63596 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 20 Mar 2012 16:52:26 +0400 Subject: [PATCH] GitInit: don't show the error if executable is not valid. It is notified separately from GitHandler.start(). --- plugins/git4idea/src/git4idea/actions/GitInit.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/git4idea/src/git4idea/actions/GitInit.java b/plugins/git4idea/src/git4idea/actions/GitInit.java index 685cb743a30f..43aa23976177 100644 --- a/plugins/git4idea/src/git4idea/actions/GitInit.java +++ b/plugins/git4idea/src/git4idea/actions/GitInit.java @@ -80,11 +80,13 @@ public class GitInit extends DumbAwareAction { } Git git = ServiceManager.getService(Git.class); - + GitVcs vcs = GitVcs.getInstance(project); GitCommandResult result = git.init(project, root); if (!result.success()) { - GitUIUtil.notify(GitVcs.IMPORTANT_ERROR_NOTIFICATION, project, "Git init failed", result.getErrorOutputAsHtmlString(), - NotificationType.ERROR, null); + if (vcs != null && vcs.getExecutableValidator().isExecutableValid()) { + GitUIUtil.notify(GitVcs.IMPORTANT_ERROR_NOTIFICATION, project, "Git init failed", result.getErrorOutputAsHtmlString(), + NotificationType.ERROR, null); + } return; }