diff --git a/plugins/git4idea/src/git4idea/GitDeprecatedRemote.java b/plugins/git4idea/src/git4idea/GitDeprecatedRemote.java index d0bbfa8b9e86..22faa3841fbf 100644 --- a/plugins/git4idea/src/git4idea/GitDeprecatedRemote.java +++ b/plugins/git4idea/src/git4idea/GitDeprecatedRemote.java @@ -19,7 +19,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vcs.VcsException; -import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.containers.ContainerUtil; @@ -160,7 +159,6 @@ public final class GitDeprecatedRemote { */ public static List list(Project project, VirtualFile root) throws VcsException { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.REMOTE); - handler.setNoSSH(true); handler.setSilent(true); handler.addParameters("-v"); String output = handler.run(); diff --git a/plugins/git4idea/src/git4idea/GitRevisionNumber.java b/plugins/git4idea/src/git4idea/GitRevisionNumber.java index fda5e3fa8e13..cd6387a4e629 100644 --- a/plugins/git4idea/src/git4idea/GitRevisionNumber.java +++ b/plugins/git4idea/src/git4idea/GitRevisionNumber.java @@ -209,7 +209,6 @@ public class GitRevisionNumber implements ShortVcsRevisionNumber { */ public static GitRevisionNumber resolve(Project project, VirtualFile vcsRoot, @NonNls String rev) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, vcsRoot, GitCommand.REV_LIST); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--timestamp", "--max-count=1", rev); h.endOptions(); diff --git a/plugins/git4idea/src/git4idea/GitTag.java b/plugins/git4idea/src/git4idea/GitTag.java index be875f1af791..12ae1d171949 100644 --- a/plugins/git4idea/src/git4idea/GitTag.java +++ b/plugins/git4idea/src/git4idea/GitTag.java @@ -65,7 +65,6 @@ public class GitTag extends GitReference { public static void listAsStrings(final Project project, final VirtualFile root, final Collection tags, @Nullable final String containingCommit) throws VcsException { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.TAG); - handler.setNoSSH(true); handler.setSilent(true); handler.addParameters("-l"); if (containingCommit != null) { diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java index d2bd20b8d4f8..a953fe19a4de 100644 --- a/plugins/git4idea/src/git4idea/GitUtil.java +++ b/plugins/git4idea/src/git4idea/GitUtil.java @@ -522,7 +522,6 @@ public class GitUtil { final Consumer consumer, boolean skipDiffsForMerge) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); h.setSilent(true); - h.setNoSSH(true); h.addParameters("--pretty=format:%x04%x01" + GitChangeUtils.COMMITTED_CHANGELIST_FORMAT, "--name-status"); parametersSpecifier.consume(h); @@ -937,7 +936,6 @@ public class GitUtil { if (staged) { diff.addParameters("--cached"); } - diff.setNoSSH(true); diff.setStdoutSuppressed(true); diff.setStderrSuppressed(true); diff.setSilent(true); diff --git a/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java b/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java index 82a261cdc3af..213a96055527 100644 --- a/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java +++ b/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java @@ -146,7 +146,6 @@ public class GitAnnotationProvider implements AnnotationProvider, VcsCacheableAn final List revisions, final VirtualFile file) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(myProject, GitUtil.getGitRoot(repositoryFilePath), GitCommand.BLAME); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.setCharset(file.getCharset()); h.addParameters("-p", "-l", "-t", "-w"); diff --git a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java index 3ac218b7fb7a..a9dcb401852a 100644 --- a/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java +++ b/plugins/git4idea/src/git4idea/branch/GitBranchUtil.java @@ -125,7 +125,6 @@ public class GitBranchUtil { private static GitLocalBranch getCurrentBranchFromGit(@NotNull Project project, @NotNull VirtualFile root) { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.REV_PARSE); handler.addParameters("--abbrev-ref", "HEAD"); - handler.setNoSSH(true); handler.setSilent(true); try { String name = handler.run(); diff --git a/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java b/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java index 760b77f096c3..416cc1fbd061 100644 --- a/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java +++ b/plugins/git4idea/src/git4idea/changes/GitChangeUtils.java @@ -189,14 +189,12 @@ public class GitChangeUtils { GitSimpleHandler handler = new GitSimpleHandler(project, vcsRoot, GitCommand.REV_LIST); handler.addParameters("--timestamp", "--max-count=1", reference); handler.endOptions(); - handler.setNoSSH(true); handler.setSilent(true); String output = handler.run(); StringTokenizer stk = new StringTokenizer(output, "\n\r \t", false); if (!stk.hasMoreTokens()) { GitSimpleHandler dh = new GitSimpleHandler(project, vcsRoot, GitCommand.LOG); dh.addParameters("-1", "HEAD"); - dh.setNoSSH(true); dh.setSilent(true); String out = dh.run(); LOG.info("Diagnostic output from 'git log -1 HEAD': [" + out + "]"); @@ -241,7 +239,6 @@ public class GitChangeUtils { boolean skipDiffsForMerge, boolean local, boolean revertable) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.SHOW); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--name-status", "--no-abbrev", "-M", "--pretty=format:" + COMMITTED_CHANGELIST_FORMAT, "--encoding=UTF-8", revisionName, "--"); @@ -253,7 +250,6 @@ public class GitChangeUtils { @Nullable public static String getCommitAbbreviation(final Project project, final VirtualFile root, final SHAHash hash) { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--max-count=1", "--pretty=%h", "--encoding=UTF-8", "\"" + hash.getValue() + "\"", "--"); try { @@ -270,7 +266,6 @@ public class GitChangeUtils { public static SHAHash commitExists(final Project project, final VirtualFile root, final String anyReference, List paths, final String... parameters) { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); - h.setNoSSH(true); h.setSilent(true); h.addParameters(parameters); h.addParameters("--max-count=1", "--pretty=%H", "--encoding=UTF-8", anyReference, "--"); @@ -290,7 +285,6 @@ public class GitChangeUtils { public static boolean isAnyLevelChild(final Project project, final VirtualFile root, final SHAHash parent, final String anyReferenceChild) { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.MERGE_BASE); - h.setNoSSH(true); h.setSilent(true); h.addParameters("\"" + parent.getValue() + "\"","\"" + anyReferenceChild + "\"", "--"); try { @@ -306,7 +300,6 @@ public class GitChangeUtils { @Nullable public static List commitExistsByComment(final Project project, final VirtualFile root, final String anyReference) { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); - h.setNoSSH(true); h.setSilent(true); String escaped = StringUtil.escapeQuotes(anyReference); escaped = StringUtil.escapeSlashes(escaped); @@ -389,7 +382,6 @@ public class GitChangeUtils { for (String parent : parents) { final GitRevisionNumber parentRevision = resolveReference(project, root, parent); GitSimpleHandler diffHandler = new GitSimpleHandler(project, root, GitCommand.DIFF); - diffHandler.setNoSSH(true); diffHandler.setSilent(true); diffHandler.addParameters("--name-status", "-M", parentRevision.getRev(), thisRevision.getRev()); String diff = diffHandler.run(); @@ -463,7 +455,6 @@ public class GitChangeUtils { @NotNull String diffRange, @Nullable Collection dirtyPaths) { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.DIFF); handler.addParameters("--name-status", "--diff-filter=ADCMRUXT", "-M", diffRange); - handler.setNoSSH(true); handler.setSilent(true); handler.setStdoutSuppressed(true); handler.endOptions(); diff --git a/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java b/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java index 3be534abef2e..d6b1ada21827 100644 --- a/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java +++ b/plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java @@ -248,7 +248,6 @@ public class GitCheckinEnvironment implements CheckinEnvironment { HashSet realRemoved = new HashSet(); // perform diff GitSimpleHandler diff = new GitSimpleHandler(project, root, GitCommand.DIFF); - diff.setNoSSH(true); diff.setSilent(true); diff.setStdoutSuppressed(true); diff.addParameters("--diff-filter=ADMRUX", "--name-status", "HEAD"); @@ -323,7 +322,6 @@ public class GitCheckinEnvironment implements CheckinEnvironment { // perform merge commit try { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.COMMIT); - handler.setNoSSH(true); handler.addParameters("-F", messageFile.getAbsolutePath()); if (author != null) { handler.addParameters("--author=" + author); @@ -469,7 +467,6 @@ public class GitCheckinEnvironment implements CheckinEnvironment { boolean amend = nextCommitAmend; for (List paths : VcsFileUtil.chunkPaths(root, files)) { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.COMMIT); - handler.setNoSSH(true); if (amend) { handler.addParameters("--amend"); } diff --git a/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java b/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java index f745aec53e86..4837c04bd311 100644 --- a/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java +++ b/plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java @@ -26,10 +26,7 @@ import com.intellij.ui.DocumentAdapter; import com.intellij.ui.EditorComboBox; import com.intellij.util.ArrayUtil; import git4idea.GitUtil; -import git4idea.commands.GitCommand; -import git4idea.commands.GitLineHandlerPasswordRequestAware; -import git4idea.commands.GitTask; -import git4idea.commands.GitTaskResult; +import git4idea.commands.*; import git4idea.i18n.GitBundle; import git4idea.remote.GitRememberedInputs; import org.jetbrains.annotations.NonNls; @@ -167,6 +164,7 @@ public class GitCloneDialog extends DialogWrapper { */ private boolean test(String url) { final GitLineHandlerPasswordRequestAware handler = new GitLineHandlerPasswordRequestAware(myProject, new File("."), GitCommand.LS_REMOTE); + handler.setRemoteProtocol(GitRemoteProtocol.SSH); handler.addParameters(url, "master"); GitTask task = new GitTask(myProject, handler, GitBundle.message("clone.testing", url)); GitTaskResult result = task.executeModal(); diff --git a/plugins/git4idea/src/git4idea/commands/GitHandler.java b/plugins/git4idea/src/git4idea/commands/GitHandler.java index e50e95952094..9832ba19483c 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitHandler.java @@ -82,9 +82,6 @@ public abstract class GitHandler { @NonNls private Charset myCharset = Charset.forName("UTF-8"); // Character set to use for IO - @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) - private boolean myNoSSHFlag = false; - private final EventDispatcher myListeners = EventDispatcher.create(ProcessEventListener.class); @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) protected boolean mySilent; // if true, the command execution is not logged in version control view @@ -100,6 +97,7 @@ public abstract class GitHandler { private long myStartTime; // git execution start timestamp private static final long LONG_TIME = 10 * 1000; @Nullable private ModalityState myState; + @Nullable private GitRemoteProtocol myRemoteProtocol; /** @@ -219,23 +217,12 @@ public abstract class GitHandler { return file; } - /** - * Set SSH flag. This flag should be set to true for commands that never interact with remote repositories. - * - * @param value if value is true, the custom ssh is not used for the command. - */ - @SuppressWarnings({"WeakerAccess", "SameParameterValue"}) - public void setNoSSH(boolean value) { - checkNotStarted(); - myNoSSHFlag = value; + public void setRemoteProtocol(@NotNull GitRemoteProtocol remoteProtocol) { + myRemoteProtocol = remoteProtocol; } - /** - * @return true if SSH is not invoked by this command. - */ - @SuppressWarnings({"WeakerAccess"}) - public boolean isNoSSH() { - return myNoSSHFlag; + protected boolean isRemote() { + return myRemoteProtocol != null; } /** @@ -430,7 +417,7 @@ public abstract class GitHandler { } // setup environment - if (!myNoSSHFlag && myProjectSettings.isIdeaSsh()) { + if (myRemoteProtocol == GitRemoteProtocol.SSH && myProjectSettings.isIdeaSsh()) { GitSSHService ssh = GitSSHIdeaService.getInstance(); myEnv.put(GitSSHHandler.GIT_SSH_ENV, ssh.getScriptPath().getPath()); myHandlerNo = ssh.registerHandler(new GitSSHGUIHandler(myProject, myState)); @@ -502,7 +489,7 @@ public abstract class GitHandler { * Cleanup environment */ protected synchronized void cleanupEnv() { - if (!myNoSSHFlag && !myEnvironmentCleanedUp) { + if (myRemoteProtocol == GitRemoteProtocol.SSH && !myEnvironmentCleanedUp) { GitSSHService ssh = GitSSHIdeaService.getInstance(); myEnvironmentCleanedUp = true; ssh.unregisterHandler(myHandlerNo); diff --git a/plugins/git4idea/src/git4idea/commands/GitImpl.java b/plugins/git4idea/src/git4idea/commands/GitImpl.java index 270752e434d0..e4ed79da21e5 100644 --- a/plugins/git4idea/src/git4idea/commands/GitImpl.java +++ b/plugins/git4idea/src/git4idea/commands/GitImpl.java @@ -101,7 +101,6 @@ public class GitImpl implements Git { throws VcsException { final Set untrackedFiles = new HashSet(); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LS_FILES); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--exclude-standard", "--others", "-z"); h.endOptions(); @@ -133,11 +132,12 @@ public class GitImpl implements Git { public GitCommandResult clone(@NotNull Project project, @NotNull File parentDirectory, @NotNull String url, @NotNull String clonedDirectoryName, @NotNull GitLineHandlerListener... listeners) { GitLineHandlerPasswordRequestAware handler = new GitLineHandlerPasswordRequestAware(project, parentDirectory, GitCommand.CLONE); + handler.setRemoteProtocol(GitRemoteProtocol.SSH); handler.addParameters("--progress"); handler.addParameters(url); handler.addParameters(clonedDirectoryName); addListeners(handler, listeners); - return run(handler, true); + return run(handler); } @NotNull @@ -154,7 +154,6 @@ public class GitImpl implements Git { final GitLineHandler diff = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.DIFF); diff.addParameters(parameters); diff.addParameters(range); - diff.setNoSSH(true); diff.setStdoutSuppressed(true); diff.setStderrSuppressed(true); diff.setSilent(true); @@ -361,12 +360,13 @@ public class GitImpl implements Git { @NotNull GitLineHandlerListener... listeners) { final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitCommand.PUSH); + h.setRemoteProtocol(GitRemoteProtocol.SSH); h.setSilent(false); addListeners(h, listeners); h.addProgressParameter(); h.addParameters(remote); h.addParameters(spec); - return run(h, true); + return run(h); } @Override @@ -417,16 +417,10 @@ public class GitImpl implements Git { } } - private static GitCommandResult run(@NotNull GitLineHandler handler) { - return run(handler, false); - } - /** * Runs the given {@link GitLineHandler} in the current thread and returns the {@link GitCommandResult}. */ - private static GitCommandResult run(@NotNull GitLineHandler handler, boolean remote) { - handler.setNoSSH(!remote); - + private static GitCommandResult run(@NotNull GitLineHandler handler) { final List errorOutput = new ArrayList(); final List output = new ArrayList(); final AtomicInteger exitCode = new AtomicInteger(); diff --git a/plugins/git4idea/src/git4idea/commands/GitRemoteProtocol.java b/plugins/git4idea/src/git4idea/commands/GitRemoteProtocol.java new file mode 100644 index 000000000000..9747b06ffd66 --- /dev/null +++ b/plugins/git4idea/src/git4idea/commands/GitRemoteProtocol.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package git4idea.commands; + +/** +* @author Kirill Likhodedov +*/ +public enum GitRemoteProtocol { + GIT, + SSH, + HTTP +} diff --git a/plugins/git4idea/src/git4idea/commands/GitSimpleHandler.java b/plugins/git4idea/src/git4idea/commands/GitSimpleHandler.java index 75436608246b..b1500259f4e7 100644 --- a/plugins/git4idea/src/git4idea/commands/GitSimpleHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitSimpleHandler.java @@ -192,8 +192,8 @@ public class GitSimpleHandler extends GitTextHandler { * @throws VcsException exception if process failed to start. */ public String run() throws VcsException { - if (!isNoSSH()) { - throw new IllegalStateException("Commands that require SSH could not be run using this method"); + if (isRemote()) { + throw new IllegalStateException("Commands that require remote access could not be run using this method"); } final VcsException[] ex = new VcsException[1]; final String[] result = new String[1]; diff --git a/plugins/git4idea/src/git4idea/config/GitConfigUtil.java b/plugins/git4idea/src/git4idea/config/GitConfigUtil.java index b5dd005d38b0..4212fe4a2247 100644 --- a/plugins/git4idea/src/git4idea/config/GitConfigUtil.java +++ b/plugins/git4idea/src/git4idea/config/GitConfigUtil.java @@ -54,7 +54,6 @@ public class GitConfigUtil { */ public static void getValues(Project project, VirtualFile root, String keyMask, Map result) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.CONFIG); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--null"); if (keyMask != null) { @@ -89,7 +88,6 @@ public class GitConfigUtil { public static List> getAllValues(Project project, VirtualFile root, @NonNls String key) throws VcsException { List> result = new ArrayList>(); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.CONFIG); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--null", "--get-all", key); String output = h.run(); @@ -116,7 +114,6 @@ public class GitConfigUtil { @Nullable public static String getValue(Project project, VirtualFile root, @NonNls String key) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.CONFIG); - h.setNoSSH(true); h.setSilent(true); h.ignoreErrorCode(1); h.addParameters("--null", "--get", key); @@ -225,7 +222,6 @@ public class GitConfigUtil { */ public static void unsetValue(Project project, VirtualFile root, String key) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.CONFIG); - h.setNoSSH(true); h.setSilent(true); h.ignoreErrorCode(1); h.addParameters("--unset", key); @@ -243,7 +239,6 @@ public class GitConfigUtil { */ public static void setValue(Project project, VirtualFile root, String key, String value, String... additionalParameters) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.CONFIG); - h.setNoSSH(true); h.setSilent(true); h.ignoreErrorCode(1); h.addParameters(additionalParameters); diff --git a/plugins/git4idea/src/git4idea/diff/GitTreeDiffProvider.java b/plugins/git4idea/src/git4idea/diff/GitTreeDiffProvider.java index 5545c77b0360..10c133887168 100644 --- a/plugins/git4idea/src/git4idea/diff/GitTreeDiffProvider.java +++ b/plugins/git4idea/src/git4idea/diff/GitTreeDiffProvider.java @@ -55,7 +55,6 @@ public class GitTreeDiffProvider implements TreeDiffProvider { for (List pathList : VcsFileUtil.chunkPaths(vcsRoot, files)) { GitSimpleHandler handler = new GitSimpleHandler(myProject, vcsRoot, GitCommand.DIFF); handler.addParameters("--name-status", "--diff-filter=ADCRUX", "-M", "HEAD..." + searcher.getRemote().getFullName()); - handler.setNoSSH(true); handler.setSilent(true); handler.setStdoutSuppressed(true); handler.endOptions(); diff --git a/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java b/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java index 141dcf710096..b3c8e441f238 100644 --- a/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java +++ b/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java @@ -88,7 +88,6 @@ public class GitHistoryUtils { public static long getHeadTs(final Project project, FilePath filePath) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, GitUtil.getGitRoot(filePath), GitCommand.LOG); GitLogParser parser = new GitLogParser(project, SHORT_HASH, COMMIT_TIME); - h.setNoSSH(true); h.setSilent(true); h.addParameters("-n1", parser.getPretty()); h.addParameters("HEAD"); @@ -111,7 +110,6 @@ public class GitHistoryUtils { filePath = getLastCommitName(project, filePath); GitSimpleHandler h = new GitSimpleHandler(project, GitUtil.getGitRoot(filePath), GitCommand.LOG); GitLogParser parser = shortHash ? new GitLogParser(project, SHORT_HASH, COMMIT_TIME) : new GitLogParser(project, HASH, COMMIT_TIME); - h.setNoSSH(true); h.setSilent(true); h.addParameters("-n1", parser.getPretty()); h.addParameters(!StringUtil.isEmpty(branch) ? branch : "--all"); @@ -134,7 +132,6 @@ public class GitHistoryUtils { filePath = getLastCommitName(project, filePath); GitSimpleHandler h = new GitSimpleHandler(project, GitUtil.getGitRoot(filePath), GitCommand.LOG); GitLogParser parser = new GitLogParser(project, HASH, COMMIT_TIME, AUTHOR_NAME, COMMITTER_NAME, SUBJECT, BODY, RAW_BODY); - h.setNoSSH(true); h.setSilent(true); h.addParameters("-n1", parser.getPretty()); if (branch != null && !branch.isEmpty()) { @@ -179,7 +176,6 @@ public class GitHistoryUtils { filePath = getLastCommitName(project, filePath); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, HASH, COMMIT_TIME, SHORT_PARENTS); - h.setNoSSH(true); h.setSilent(true); h.addParameters("-n1", parser.getPretty(), "--name-status", t.getFullName()); h.endOptions(); @@ -202,7 +198,6 @@ public class GitHistoryUtils { if (! GitUtil.isGitRoot(new File(root.getPath()))) throw new VcsException("Path " + root.getPath() + " is not git repository root"); final GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--branches", "--remotes", "--tags", "--pretty=format:%H%x20%ct%x0A", "--date-order", "--reverse", "--encoding=UTF-8", "--full-history", "--sparse"); @@ -447,7 +442,6 @@ public class GitHistoryUtils { private static GitLineHandler getLogHandler(Project project, VirtualFile root, GitLogParser parser, FilePath path, String lastCommit, String... parameters) { final GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters("--name-status", parser.getPretty(), "--encoding=UTF-8", lastCommit); if (parameters != null && parameters.length > 0) { @@ -469,7 +463,6 @@ public class GitHistoryUtils { // NB: we can't specify the filepath, because then rename detection will work only with the '--follow' option, which we don't wanna use. final GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.SHOW); final GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, HASH, COMMIT_TIME, SHORT_PARENTS); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters("-M", "--name-status", parser.getPretty(), "--encoding=UTF-8", commit); h.endOptions(); @@ -578,7 +571,6 @@ public class GitHistoryUtils { path = getLastCommitName(project, path); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); GitLogParser parser = new GitLogParser(project, HASH, COMMIT_TIME); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters(parameters); h.addParameters(parser.getPretty(), "--encoding=UTF-8"); @@ -626,7 +618,6 @@ public class GitHistoryUtils { final GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG); final GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, SHORT_HASH, HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_TIME, AUTHOR_EMAIL, COMMITTER_NAME, COMMITTER_EMAIL, SHORT_PARENTS, REF_NAMES, SUBJECT, BODY, RAW_BODY); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters(parameters); h.addParameters("--name-status", parser.getPretty(), "--encoding=UTF-8"); @@ -763,7 +754,6 @@ public class GitHistoryUtils { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.STASH.readLockingCommand()); GitLogParser parser = new GitLogParser(project, SHORT_HASH, SHORT_PARENTS); h.setSilent(true); - h.setNoSSH(true); h.addParameters("list"); h.addParameters("-n1"); h.addParameters(parser.getPretty()); @@ -778,7 +768,6 @@ public class GitHistoryUtils { GitSimpleHandler h1 = new GitSimpleHandler(project, root, GitCommand.LOG); GitLogParser parser1 = new GitLogParser(project, SHORT_HASH, SHORT_PARENTS, SUBJECT); h1.setSilent(true); - h1.setNoSSH(true); h1.addParameters("-n1"); h1.addParameters(parser1.getPretty()); //h1.endOptions(); @@ -813,7 +802,6 @@ public class GitHistoryUtils { GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, SHORT_HASH, HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_TIME, AUTHOR_EMAIL, COMMITTER_NAME, COMMITTER_EMAIL, SHORT_PARENTS, REF_NAMES, SHORT_REF_LOG_SELECTOR, SUBJECT, BODY, RAW_BODY); h.setSilent(true); - h.setNoSSH(true); h.addParameters("list"); h.addParameters(parameters); h.addParameters(parser.getPretty()); @@ -840,7 +828,6 @@ public class GitHistoryUtils { GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, SHORT_HASH, HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_TIME, AUTHOR_EMAIL, COMMITTER_NAME, COMMITTER_EMAIL, SHORT_PARENTS, REF_NAMES, SUBJECT, BODY, RAW_BODY); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters("--name-status", "-M", parser.getPretty(), "--encoding=UTF-8"); h.addParameters(new ArrayList(commitsIds)); @@ -860,7 +847,6 @@ public class GitHistoryUtils { final VirtualFile root = GitUtil.getGitRoot(path); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.SHOW); GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.STATUS, AUTHOR_TIME); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--name-status", parser.getPretty(), "--encoding=UTF-8"); h.addParameters(commitsId); @@ -878,7 +864,6 @@ public class GitHistoryUtils { final VirtualFile root = GitUtil.getGitRoot(path); final GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG); final GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.NAME, SHORT_HASH, COMMIT_TIME, SHORT_PARENTS, AUTHOR_NAME); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters(parameters); h.addParameters(parser.getPretty(), "--encoding=UTF-8", "--full-history"); @@ -953,7 +938,6 @@ public class GitHistoryUtils { @NotNull final String second) throws VcsException { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.MERGE_BASE); - h.setNoSSH(true); h.setSilent(true); h.addParameters(first, second); String output = h.run().trim(); diff --git a/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java b/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java index fe9b068fb2c7..43fadf6013bf 100644 --- a/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java +++ b/plugins/git4idea/src/git4idea/history/browser/LowLevelAccessImpl.java @@ -205,7 +205,6 @@ public class LowLevelAccessImpl implements LowLevelAccess { @Nullable String containingCommit) throws VcsException { // preparing native command executor final GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.BRANCH); - handler.setNoSSH(true); handler.setSilent(true); handler.addParameters("--no-color"); boolean remoteOnly = false; diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java b/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java index 78d0ee99da6d..294227718670 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeDialog.java @@ -156,7 +156,6 @@ public class GitMergeDialog extends DialogWrapper { public void updateBranches() throws VcsException { VirtualFile root = getSelectedRoot(); GitSimpleHandler handler = new GitSimpleHandler(myProject, root, GitCommand.BRANCH); - handler.setNoSSH(true); handler.setSilent(true); handler.addParameters("--no-color", "-a", "--no-merged"); String output = handler.run(); @@ -178,7 +177,6 @@ public class GitMergeDialog extends DialogWrapper { GitLineHandler h = new GitLineHandler(myProject, root, GitCommand.MERGE); // ignore merge failure h.ignoreErrorCode(1); - h.setNoSSH(true); if (myNoCommitCheckBox.isSelected()) { h.addParameters("--no-commit"); } diff --git a/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java b/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java index 4094af361950..a2bc9e4794a6 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java +++ b/plugins/git4idea/src/git4idea/merge/GitMergeProvider.java @@ -288,7 +288,6 @@ public class GitMergeProvider implements MergeProvider2 { VirtualFile root = e.getKey(); List files = e.getValue(); GitSimpleHandler h = new GitSimpleHandler(myProject, root, GitCommand.LS_FILES); - h.setNoSSH(true); h.setStdoutSuppressed(true); h.setSilent(true); h.addParameters("--exclude-standard", "--unmerged", "-t", "-z"); diff --git a/plugins/git4idea/src/git4idea/merge/GitMerger.java b/plugins/git4idea/src/git4idea/merge/GitMerger.java index 4605aeb405d0..4a94c720635a 100644 --- a/plugins/git4idea/src/git4idea/merge/GitMerger.java +++ b/plugins/git4idea/src/git4idea/merge/GitMerger.java @@ -65,7 +65,6 @@ public class GitMerger { public void mergeCommit(VirtualFile root) throws VcsException { GitSimpleHandler handler = new GitSimpleHandler(myProject, root, GitCommand.COMMIT); - handler.setNoSSH(true); File gitDir = new File(VfsUtilCore.virtualToIoFile(root), GitUtil.DOT_GIT); File messageFile = new File(gitDir, GitRepositoryFiles.MERGE_MSG); diff --git a/plugins/git4idea/src/git4idea/merge/GitPullDialog.java b/plugins/git4idea/src/git4idea/merge/GitPullDialog.java index d44804cb59ab..90680a44df1b 100644 --- a/plugins/git4idea/src/git4idea/merge/GitPullDialog.java +++ b/plugins/git4idea/src/git4idea/merge/GitPullDialog.java @@ -27,6 +27,7 @@ import git4idea.GitRemoteBranch; import git4idea.GitUtil; import git4idea.commands.GitCommand; import git4idea.commands.GitLineHandler; +import git4idea.commands.GitRemoteProtocol; import git4idea.i18n.GitBundle; import git4idea.repo.GitBranchTrackInfo; import git4idea.repo.GitRemote; @@ -158,6 +159,7 @@ public class GitPullDialog extends DialogWrapper { // ignore merge failure for the pull h.ignoreErrorCode(1); if (pull) { + h.setRemoteProtocol(GitRemoteProtocol.SSH); h.addProgressParameter(); } h.addParameters("--no-stat"); diff --git a/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java b/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java index fbd99cf2ad6d..c72e738851fa 100644 --- a/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java +++ b/plugins/git4idea/src/git4idea/merge/MergeChangeCollector.java @@ -84,7 +84,6 @@ public class MergeChangeCollector { public @NotNull Set getUnmergedPaths() throws VcsException { String root = myRoot.getPath(); final GitSimpleHandler h = new GitSimpleHandler(myProject, myRoot, GitCommand.LS_FILES); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--unmerged"); final String result = h.run(); @@ -158,7 +157,6 @@ public class MergeChangeCollector { String root = myRoot.getPath(); GitSimpleHandler h = new GitSimpleHandler(myProject, myRoot, GitCommand.DIFF); h.setSilent(true); - h.setNoSSH(true); // note that moves are not detected here h.addParameters("--name-status", "--diff-filter=ADMRUX", revisions); for (StringScanner s = new StringScanner(h.run()); s.hasMoreData();) { diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java b/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java index 19828846ceab..97d58b70681c 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseDialog.java @@ -163,7 +163,6 @@ public class GitRebaseDialog extends DialogWrapper { public GitLineHandler handler() { GitLineHandler h = new GitLineHandler(myProject, gitRoot(), GitCommand.REBASE); - h.setNoSSH(true); if (myInteractiveCheckBox.isSelected() && myInteractiveCheckBox.isEnabled()) { h.addParameters("-i"); } diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaser.java b/plugins/git4idea/src/git4idea/rebase/GitRebaser.java index ba28df93c802..aeee09c6931a 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaser.java +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaser.java @@ -225,7 +225,6 @@ public class GitRebaser { private void stageEverything(@NotNull VirtualFile root) throws VcsException { GitSimpleHandler handler = new GitSimpleHandler(myProject, root, GitCommand.ADD); handler.setSilent(false); - handler.setNoSSH(true); handler.addParameters("--update"); handler.run(); } diff --git a/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java b/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java index 9c67e64fe7fe..00f1830e6255 100644 --- a/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java +++ b/plugins/git4idea/src/git4idea/rollback/GitRollbackEnvironment.java @@ -179,7 +179,6 @@ public class GitRollbackEnvironment implements RollbackEnvironment { public void revert(final VirtualFile root, final List files) throws VcsException { for (List paths : VcsFileUtil.chunkPaths(root, files)) { GitSimpleHandler handler = new GitSimpleHandler(myProject, root, GitCommand.CHECKOUT); - handler.setNoSSH(true); handler.addParameters("HEAD"); handler.endOptions(); handler.addParameters(paths); @@ -247,7 +246,6 @@ public class GitRollbackEnvironment implements RollbackEnvironment { public static void resetHardLocal(final Project project, final VirtualFile root) { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.RESET); - handler.setNoSSH(true); handler.addParameters("--hard"); handler.endOptions(); GitHandlerUtil.runInCurrentThread(handler, null); diff --git a/plugins/git4idea/src/git4idea/stash/GitStashUtils.java b/plugins/git4idea/src/git4idea/stash/GitStashUtils.java index 90cfac4153c6..e1da8a349d8a 100644 --- a/plugins/git4idea/src/git4idea/stash/GitStashUtils.java +++ b/plugins/git4idea/src/git4idea/stash/GitStashUtils.java @@ -56,7 +56,6 @@ public class GitStashUtils { final Consumer consumer) { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.STASH.readLockingCommand()); h.setSilent(true); - h.setNoSSH(true); h.addParameters("list"); String out; try { diff --git a/plugins/git4idea/src/git4idea/status/GitNewChangesCollector.java b/plugins/git4idea/src/git4idea/status/GitNewChangesCollector.java index b231ec1c14f2..a2188b74bcda 100644 --- a/plugins/git4idea/src/git4idea/status/GitNewChangesCollector.java +++ b/plugins/git4idea/src/git4idea/status/GitNewChangesCollector.java @@ -121,7 +121,6 @@ class GitNewChangesCollector extends GitChangesCollector { GitSimpleHandler handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.STATUS); final String[] params = {"--porcelain", "-z", "--untracked-files=no"}; // untracked files are stored separately handler.addParameters(params); - handler.setNoSSH(true); handler.setSilent(true); handler.setStdoutSuppressed(true); handler.endOptions(); @@ -130,7 +129,6 @@ class GitNewChangesCollector extends GitChangesCollector { // if there are too much files, just get all changes for the project handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.STATUS); handler.addParameters(params); - handler.setNoSSH(true); handler.setSilent(true); handler.setStdoutSuppressed(true); handler.endOptions(); diff --git a/plugins/git4idea/src/git4idea/status/GitOldChangesCollector.java b/plugins/git4idea/src/git4idea/status/GitOldChangesCollector.java index 9e9354e60399..17ef984c6557 100644 --- a/plugins/git4idea/src/git4idea/status/GitOldChangesCollector.java +++ b/plugins/git4idea/src/git4idea/status/GitOldChangesCollector.java @@ -134,7 +134,6 @@ class GitOldChangesCollector extends GitChangesCollector { GitSimpleHandler handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.UPDATE_INDEX); handler.addParameters("--refresh", "--ignore-missing"); handler.setSilent(true); - handler.setNoSSH(true); handler.setStdoutSuppressed(true); handler.ignoreErrorCode(1); handler.run(); @@ -161,7 +160,6 @@ class GitOldChangesCollector extends GitChangesCollector { } GitSimpleHandler handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.LS_FILES); handler.addParameters("--cached"); - handler.setNoSSH(true); handler.setSilent(true); handler.setStdoutSuppressed(true); // During init diff does not works because HEAD @@ -193,7 +191,6 @@ class GitOldChangesCollector extends GitChangesCollector { GitSimpleHandler handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.LS_FILES); handler.addParameters("-v", "--unmerged"); handler.setSilent(true); - handler.setNoSSH(true); handler.setStdoutSuppressed(true); // run handler and collect changes parseFiles(handler.run()); @@ -201,7 +198,6 @@ class GitOldChangesCollector extends GitChangesCollector { handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.LS_FILES); handler.addParameters("-v", "--others", "--exclude-standard"); handler.setSilent(true); - handler.setNoSSH(true); handler.setStdoutSuppressed(true); handler.endOptions(); handler.addRelativePaths(dirtyPaths); @@ -209,7 +205,6 @@ class GitOldChangesCollector extends GitChangesCollector { handler = new GitSimpleHandler(myProject, myVcsRoot, GitCommand.LS_FILES); handler.addParameters("-v", "--others", "--exclude-standard"); handler.setSilent(true); - handler.setNoSSH(true); handler.setStdoutSuppressed(true); handler.endOptions(); } diff --git a/plugins/git4idea/src/git4idea/ui/GitResetDialog.java b/plugins/git4idea/src/git4idea/ui/GitResetDialog.java index a208052d36bd..6600ee256acd 100644 --- a/plugins/git4idea/src/git4idea/ui/GitResetDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitResetDialog.java @@ -118,7 +118,6 @@ public class GitResetDialog extends DialogWrapper { */ public GitLineHandler handler() { GitLineHandler handler = new GitLineHandler(myProject, getGitRoot(), GitCommand.RESET); - handler.setNoSSH(true); String type = (String)myResetTypeComboBox.getSelectedItem(); if (SOFT.equals(type)) { handler.addParameters("--soft"); diff --git a/plugins/git4idea/src/git4idea/ui/GitTagDialog.java b/plugins/git4idea/src/git4idea/ui/GitTagDialog.java index e81d49541e02..aafb3b05db0f 100644 --- a/plugins/git4idea/src/git4idea/ui/GitTagDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitTagDialog.java @@ -180,7 +180,6 @@ public class GitTagDialog extends DialogWrapper { } try { GitSimpleHandler h = new GitSimpleHandler(myProject, getGitRoot(), GitCommand.TAG); - h.setNoSSH(true); if (hasMessage) { h.addParameters("-a"); } @@ -250,7 +249,6 @@ public class GitTagDialog extends DialogWrapper { private void fetchTags() { myExistingTags.clear(); GitSimpleHandler h = new GitSimpleHandler(myProject, getGitRoot(), GitCommand.TAG); - h.setNoSSH(true); h.setSilent(true); String output = GitHandlerUtil.doSynchronously(h, GitBundle.getString("tag.getting.existing.tags"), h.printableCommandLine()); for (StringScanner s = new StringScanner(output); s.hasMoreData();) { diff --git a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java index 0e3b7175ccd6..a6790ddb3a5f 100644 --- a/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitUnstashDialog.java @@ -163,7 +163,6 @@ public class GitUnstashDialog extends DialogWrapper { GitBundle.message("git.unstash.clear.confirmation.message"), GitBundle.message("git.unstash.clear.confirmation.title"), Messages.getWarningIcon())) { GitLineHandler h = new GitLineHandler(myProject, getGitRoot(), GitCommand.STASH); - h.setNoSSH(true); h.addParameters("clear"); GitHandlerUtil.doSynchronously(h, GitBundle.getString("unstash.clearing.stashes"), h.printableCommandLine()); refreshStashList(); @@ -203,7 +202,6 @@ public class GitUnstashDialog extends DialogWrapper { private GitSimpleHandler dropHandler(String stash) { GitSimpleHandler h = new GitSimpleHandler(myProject, getGitRoot(), GitCommand.STASH); - h.setNoSSH(true); h.addParameters("drop"); addStashParameter(h, stash); return h; @@ -216,7 +214,6 @@ public class GitUnstashDialog extends DialogWrapper { String selectedStash = getSelectedStash().getStash(); try { GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.REV_LIST); - h.setNoSSH(true); h.setSilent(true); h.addParameters("--timestamp", "--max-count=1"); addStashParameter(h, selectedStash); @@ -343,7 +340,6 @@ public class GitUnstashDialog extends DialogWrapper { */ private GitLineHandler handler() { GitLineHandler h = new GitLineHandler(myProject, getGitRoot(), GitCommand.STASH); - h.setNoSSH(true); String branch = myBranchTextField.getText(); if (branch.length() == 0) { h.addParameters(myPopStashCheckBox.isSelected() ? "pop" : "apply"); diff --git a/plugins/git4idea/src/git4idea/update/GitFetcher.java b/plugins/git4idea/src/git4idea/update/GitFetcher.java index c904ab769a35..bb9f215c63fe 100644 --- a/plugins/git4idea/src/git4idea/update/GitFetcher.java +++ b/plugins/git4idea/src/git4idea/update/GitFetcher.java @@ -211,6 +211,7 @@ public class GitFetcher { private GitFetchResult fetchNatively(@NotNull VirtualFile root, @NotNull GitRemote remote, @Nullable String branch) { final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(myProject, root, GitCommand.FETCH); + h.setRemoteProtocol(GitRemoteProtocol.SSH); h.addProgressParameter(); if (GitVersionSpecialty.SUPPORTS_FETCH_PRUNE.existsIn(myVcs.getVersion())) { h.addParameters("--prune"); diff --git a/plugins/git4idea/src/git4idea/update/GitMergeUpdater.java b/plugins/git4idea/src/git4idea/update/GitMergeUpdater.java index 38bdd91983f7..6221527d79be 100644 --- a/plugins/git4idea/src/git4idea/update/GitMergeUpdater.java +++ b/plugins/git4idea/src/git4idea/update/GitMergeUpdater.java @@ -189,7 +189,6 @@ public class GitMergeUpdater extends GitUpdater { private void cancel() { try { GitSimpleHandler h = new GitSimpleHandler(myProject, myRoot, GitCommand.RESET); - h.setNoSSH(true); h.addParameters("--merge"); h.run(); } catch (VcsException e) { diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateLocallyModifiedDialog.java b/plugins/git4idea/src/git4idea/update/GitUpdateLocallyModifiedDialog.java index c295a54cda50..c3384cea20b0 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateLocallyModifiedDialog.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdateLocallyModifiedDialog.java @@ -135,7 +135,6 @@ public class GitUpdateLocallyModifiedDialog extends DialogWrapper { String rootPath = root.getPath(); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.DIFF); h.addParameters("--name-status"); - h.setNoSSH(true); h.setSilent(true); h.setStdoutSuppressed(true); StringScanner s = new StringScanner(h.run()); diff --git a/plugins/git4idea/src/git4idea/update/GitUpdater.java b/plugins/git4idea/src/git4idea/update/GitUpdater.java index 71b703a60811..6d3b44800541 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdater.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdater.java @@ -172,7 +172,6 @@ public abstract class GitUpdater { protected boolean hasRemoteChanges(@NotNull String currentBranch, @NotNull String remoteBranch) throws VcsException { GitSimpleHandler handler = new GitSimpleHandler(myProject, myRoot, GitCommand.REV_LIST); handler.setSilent(true); - handler.setNoSSH(true); handler.addParameters("-1"); handler.addParameters(currentBranch + ".." + remoteBranch); String output = handler.run(); diff --git a/plugins/git4idea/src/git4idea/util/GitFileUtils.java b/plugins/git4idea/src/git4idea/util/GitFileUtils.java index 63f040651847..14afd526c249 100644 --- a/plugins/git4idea/src/git4idea/util/GitFileUtils.java +++ b/plugins/git4idea/src/git4idea/util/GitFileUtils.java @@ -61,7 +61,6 @@ public class GitFileUtils { handler.addParameters(additionalOptions); handler.endOptions(); handler.addParameters(paths); - handler.setNoSSH(true); handler.run(); } } @@ -80,7 +79,6 @@ public class GitFileUtils { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.RM); handler.endOptions(); handler.addParameters(paths); - handler.setNoSSH(true); handler.run(); } } @@ -159,7 +157,6 @@ public class GitFileUtils { handler.addParameters("--ignore-errors"); handler.endOptions(); handler.addParameters(paths); - handler.setNoSSH(true); handler.run(); } } @@ -168,7 +165,6 @@ public class GitFileUtils { private static List excludeIgnoredFiles(@NotNull Project project, @NotNull VirtualFile root, @NotNull List paths) throws VcsException { GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.LS_FILES); - handler.setNoSSH(true); handler.setSilent(true); handler.addParameters("--ignored", "--others", "--exclude-standard"); handler.endOptions(); @@ -197,7 +193,6 @@ public class GitFileUtils { */ public static byte[] getFileContent(Project project, VirtualFile root, String revisionOrBranch, String relativePath) throws VcsException { GitBinaryHandler h = new GitBinaryHandler(project, root, GitCommand.SHOW); - h.setNoSSH(true); h.setSilent(true); h.addParameters(revisionOrBranch + ":" + relativePath); return h.run(); diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java index 9d41001a8133..18679e1bd375 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java @@ -180,7 +180,6 @@ public class GithubRebaseAction extends DumbAwareAction { LOG.info("Adding GitHub parent as a remote host"); ProgressManager.getInstance().getProgressIndicator().setText("Adding GitHub parent as a remote host"); final GitSimpleHandler addRemoteHandler = new GitSimpleHandler(project, root, GitCommand.REMOTE); - addRemoteHandler.setNoSSH(true); addRemoteHandler.setSilent(true); remoteForForkParentRepo.set("upstream"); diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java index ca427dc9c642..07802c913717 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java @@ -188,7 +188,6 @@ public class GithubShareAction extends DumbAwareAction { if (!gitDetected) { LOG.info("No git detected, creating empty git repo"); final GitLineHandler h = new GitLineHandler(project, root, GitCommand.INIT); - h.setNoSSH(true); GitHandlerUtil.doSynchronously(h, GitBundle.getString("initializing.title"), h.printableCommandLine()); if (!h.errors().isEmpty()) { GitUIUtil.showOperationErrors(project, h.errors(), "git init"); @@ -216,7 +215,6 @@ public class GithubShareAction extends DumbAwareAction { //git remote add origin git@github.com:login/name.git LOG.info("Adding GitHub as a remote host"); final GitSimpleHandler addRemoteHandler = new GitSimpleHandler(project, root, GitCommand.REMOTE); - addRemoteHandler.setNoSSH(true); addRemoteHandler.setSilent(true); final String remoteUrl = GithubApiUtil.getGitHost() + "/" + login + "/" + name + ".git"; addRemoteHandler.addParameters("add", "origin", remoteUrl); @@ -372,7 +370,6 @@ public class GithubShareAction extends DumbAwareAction { } GitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.COMMIT); handler.addParameters("-m", "First commit"); - handler.setNoSSH(true); handler.endOptions(); handler.run(); }