/** * Returns path to the {@link IgnoreLanguage} binary or null if not available. * Currently only {@link GitLanguage} is supported. * * @param language current language * @return path to binary */ @Nullable private static String bin(@NotNull IgnoreLanguage language) { if (GitLanguage.INSTANCE.equals(language) && GIT_ENABLED) { final String bin = GitExecutableManager.getInstance().getPathToGit(); return StringUtil.nullize(bin); } return null; }
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) { showErrorDialog(project, "Cannot find git executable.", "Cannot Find Git"); return false; } if (!version.isSupported()) { showErrorDialog(project, "Your version of git is not supported.", "Cannot Find Git"); return false; } return true; }
private static void addStashParameter( @NotNull Project project, @NotNull GitHandler handler, @NotNull String stash) { GitVcs vcs = GitVcs.getInstance(project); if (vcs != null && GitVersionSpecialty.NEEDS_QUOTES_IN_STASH_NAME.existsIn(vcs.getVersion())) { handler.addParameters(GeneralCommandLine.inescapableQuote(stash)); } else { handler.addParameters(stash); } }
GitConfigUtil.setValue( project, root, "credential.https://source.developers.google.com.useHttpPath", "true"); } catch (VcsException ex) {
@Override protected void setUp() throws Exception { super.setUp(); enableDebugLogging(); try { myProjectFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getTestName(true)).getFixture(); myProjectFixture.setUp(); myCodeInsightFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(myProjectFixture); // Use the context info loaded earlier to setup the environment for TF work initializeTfEnvironment(); myProject = myProjectFixture.getProject(); myProjectRoot = myProject.getBaseDir(); myProjectPath = myProjectRoot.getPath(); myGitSettings = GitVcsSettings.getInstance(myProject); myGitRepositoryManager = GitUtil.getRepositoryManager(myProject); myPlatformFacade = ServiceManager.getService(myProject, GitPlatformFacade.class); myGit = ServiceManager.getService(myProject, Git.class); myVcs = ObjectUtils.assertNotNull(GitVcs.getInstance(myProject)); myVcs.doActivate(); addSilently(); removeSilently(); EULADialog.acceptEula(); } catch (Exception e) { tearDown(); throw e; } }
@SuppressWarnings("UnresolvedPropertyKey") public 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) { Messages.showErrorDialog(project, e.getMessage(), GitBundle.getString("find.git.error.title")); return false; } if (!version.isSupported()) { Messages.showWarningDialog(project, GitBundle.message("find.git.unsupported.message", version.toString(), GitVersion.MIN), GitBundle.getString("find.git.success.title")); return false; } return true; }
private static boolean isGitSupported(final Project project) { final GitVcsApplicationSettings settings = GitVcsApplicationSettings.getInstance(); final String executable = settings.getPathToGit(); final GitVersion version; try { version = GitVersion.identifyVersion(executable); } catch (Exception ex) { Messages.showErrorDialog( project, CloudReposMessageBundle.message("uploadtogcp.giterror"), ex.getMessage()); return false; } if (!version.isSupported()) { Messages.showWarningDialog( project, CloudReposMessageBundle.message( "uploadtogcp.git.unsupported.message", version.toString(), GitVersion.MIN), CloudReposMessageBundle.message("uploadtogcp.giterror")); return false; } return true; }