Search in sources :

Example 6 with GitVersion

use of git4idea.config.GitVersion 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

GitVersion (git4idea.config.GitVersion)6 VcsException (com.intellij.openapi.vcs.VcsException)2 Test (org.junit.Test)2 ProcessOutputTypes (com.intellij.execution.process.ProcessOutputTypes)1 ReadAction (com.intellij.openapi.application.ReadAction)1 ServiceManager (com.intellij.openapi.components.ServiceManager)1 Logger (com.intellij.openapi.diagnostic.Logger)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 Project (com.intellij.openapi.project.Project)1 com.intellij.openapi.util (com.intellij.openapi.util)1 Registry (com.intellij.openapi.util.registry.Registry)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 FilePath (com.intellij.openapi.vcs.FilePath)1 FileStatus (com.intellij.openapi.vcs.FileStatus)1 Change (com.intellij.openapi.vcs.changes.Change)1 ChangeListManager (com.intellij.openapi.vcs.changes.ChangeListManager)1 ItemLatestState (com.intellij.openapi.vcs.diff.ItemLatestState)1 VcsFileRevision (com.intellij.openapi.vcs.history.VcsFileRevision)1 VcsRevisionDescription (com.intellij.openapi.vcs.history.VcsRevisionDescription)1 VcsRevisionDescriptionImpl (com.intellij.openapi.vcs.history.VcsRevisionDescriptionImpl)1