GitInit: don't show the error if executable is not valid.

It is notified separately from GitHandler.start().
This commit is contained in:
Kirill Likhodedov
2012-03-20 16:52:26 +04:00
parent 909c966137
commit 9f3d0e8ac1
@@ -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;
}