Search in sources :

Example 1 with GitVcsApplicationSettings

use of git4idea.config.GitVcsApplicationSettings in project intellij-community by JetBrains.

the class GithubUtil method testGitExecutable.

public static boolean testGitExecutable(final Project project) {
    final GitVcsApplicationSettings settings = GitVcsApplicationSettings.getInstance();
    final String executable = settings.getPathToGit();
    final GitVersion version;
    try {
        version = GitVersion.identifyVersion(executable);
    } catch (Exception e) {
        GithubNotifications.showErrorDialog(project, GitBundle.getString("find.git.error.title"), e);
        return false;
    }
    if (!version.isSupported()) {
        GithubNotifications.showWarningDialog(project, GitBundle.message("find.git.unsupported.message", version.toString(), GitVersion.MIN), GitBundle.getString("find.git.success.title"));
        return false;
    }
    return true;
}
Also used : GitVersion(git4idea.config.GitVersion) GitVcsApplicationSettings(git4idea.config.GitVcsApplicationSettings) URISyntaxException(java.net.URISyntaxException) GithubTwoFactorAuthenticationException(org.jetbrains.plugins.github.exceptions.GithubTwoFactorAuthenticationException) VcsException(com.intellij.openapi.vcs.VcsException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) GithubOperationCanceledException(org.jetbrains.plugins.github.exceptions.GithubOperationCanceledException) GithubAuthenticationException(org.jetbrains.plugins.github.exceptions.GithubAuthenticationException)

Aggregations

VcsException (com.intellij.openapi.vcs.VcsException)1 GitVcsApplicationSettings (git4idea.config.GitVcsApplicationSettings)1 GitVersion (git4idea.config.GitVersion)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 UnknownHostException (java.net.UnknownHostException)1 GithubAuthenticationException (org.jetbrains.plugins.github.exceptions.GithubAuthenticationException)1 GithubOperationCanceledException (org.jetbrains.plugins.github.exceptions.GithubOperationCanceledException)1 GithubTwoFactorAuthenticationException (org.jetbrains.plugins.github.exceptions.GithubTwoFactorAuthenticationException)1