Пример #1
0
  /** Test availability of the connection */
  private void testConnection() {
    final String executable = myGitField.getText();
    if (myAppSettings != null) {
      myAppSettings.setPathToGit(executable);
    }
    final GitVersion version;
    try {
      version = GitVersion.identifyVersion(executable);
    } catch (Exception e) {
      Messages.showErrorDialog(
          myProject, e.getMessage(), GitBundle.getString("find.git.error.title"));
      return;
    }

    if (version.isSupported()) {
      Messages.showInfoMessage(
          myProject, version.toString(), GitBundle.getString("find.git.success.title"));
    } else {
      Messages.showWarningDialog(
          myProject,
          GitBundle.message("find.git.unsupported.message", version.toString(), GitVersion.MIN),
          GitBundle.getString("find.git.success.title"));
    }
  }