[PATCH 06/12] connect: Fix custom ports with plink (Putty's ssh)
- From
Steffen Prohaska <prohaska@zib.de>
- Date
- Jul 2, 2008, 08:32 UTC
- Message-ID
- <1214987532-23640-6-git-send-email-prohaska@zib.de>
- In-Reply-To
- <1214987532-23640-5-git-send-email-prohaska@zib.de>
From: Edward Z. Yang <edwardzyang@thewritingpot.com>
PuTTY requires -P while OpenSSH requires -p; if plink is detected as GIT_SSH, use the alternate flag.
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com> Signed-off-by: Steffen Prohaska <prohaska@zib.de> --- connect.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/connect.c b/connect.c index 574f42f..0d007f3 100644 --- a/connect.c +++ b/connect.c @@ -599,11 +599,13 @@ struct child_process *git_connect(int fd[2], const char *url_orig, conn->argv = arg = xcalloc(6, sizeof(*arg)); if (protocol == PROTO_SSH) { const char *ssh = getenv("GIT_SSH"); + int putty = ssh && strstr(ssh, "plink"); if (!ssh) ssh = "ssh"; *arg++ = ssh; if (port) { - *arg++ = "-p"; + /* P is for PuTTY, p is for OpenSSH */ + *arg++ = putty ? "-P" : "-p"; *arg++ = port; } *arg++ = host;
-- 1.5.6.1.255.g32571