mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Allow using Built-in SSH with non-default port on git >= 2.16
Git tries to auto-detect ssh executable type to use correct command line. It detects Built-in SSH as simple, which does not support specifying port. Git 2.16 started to error out when port is specified in the URL and simple ssh is used. See https://public-inbox.org/git/20171120213101.yquv2ywyjajjtr5x@aiede.mtv.corp.google.com/ Git can be configured to treat builtin SSH as a regular ssh client with GIT_SSH_VARIANT environment variable set to ssh Fixes IDEA-185221
This commit is contained in:
@@ -38,6 +38,10 @@ public interface GitSSHHandler {
|
||||
* Name of environment variable for SSH executable
|
||||
*/
|
||||
@NonNls String GIT_SSH_ENV = "GIT_SSH";
|
||||
/**
|
||||
* Name of environment variable for SSH executable variant
|
||||
*/
|
||||
@NonNls String GIT_SSH_VAR = "GIT_SSH_VARIANT";
|
||||
/**
|
||||
* Name of the handler
|
||||
*/
|
||||
|
||||
@@ -110,6 +110,7 @@ class GitHandlerAuthenticationManager implements AutoCloseable {
|
||||
private void prepareSshAuth() throws IOException {
|
||||
GitXmlRpcSshService ssh = ServiceManager.getService(GitXmlRpcSshService.class);
|
||||
myHandler.addCustomEnvironmentVariable(GitSSHHandler.GIT_SSH_ENV, ssh.getScriptPath().getPath());
|
||||
myHandler.addCustomEnvironmentVariable(GitSSHHandler.GIT_SSH_VAR, "ssh");
|
||||
mySshHandler = ssh.registerHandler(new GitSSHGUIHandler(myProject, myHandler.isIgnoreAuthenticationRequest()), myProject);
|
||||
myHandler.addCustomEnvironmentVariable(GitSSHHandler.SSH_HANDLER_ENV, mySshHandler.toString());
|
||||
int port = ssh.getXmlRcpPort();
|
||||
|
||||
Reference in New Issue
Block a user