[PATCH 06/12] connect: Fix custom ports with plink (Putty's ssh)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steffen Prohaska
Date: Wednesday, July 2, 2008 - 1:32 am

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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
What's cooking in git.git (topics), Junio C Hamano, (Mon Jun 30, 2:08 am)
Re: What's cooking in git.git (topics), Kristian , (Mon Jun 30, 7:09 am)
Re: What's cooking in git.git (topics), Jakub Narebski, (Mon Jun 30, 8:58 am)
Re: What's cooking in git.git (topics), Jeff King, (Tue Jul 1, 3:11 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Tue Jul 1, 9:48 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Junio C Hamano, (Tue Jul 1, 10:39 pm)
[PATCH 03/12] MinGW: Convert CR/LF to LF in tag signatures, Steffen Prohaska, (Wed Jul 2, 1:32 am)
[PATCH 06/12] connect: Fix custom ports with plink (Putty' ..., Steffen Prohaska, (Wed Jul 2, 1:32 am)
[PATCH 11/12] verify_path(): do not allow absolute paths, Steffen Prohaska, (Wed Jul 2, 1:32 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Johannes Schindelin, (Wed Jul 2, 6:13 am)
Re: [PATCH 11/12] verify_path(): do not allow absolute paths, Steffen Prohaska, (Wed Jul 2, 7:24 am)
Re: [PATCH 11/12] verify_path(): do not allow absolute paths, Johannes Schindelin, (Wed Jul 2, 9:15 am)
Re: [msysGit] [PATCH 12/12] [TODO] setup: bring changes fr ..., Johannes Schindelin, (Wed Jul 2, 9:17 am)
Re: [PATCH 08/12] fast-import: MinGW does not have getppid ..., Johannes Schindelin, (Wed Jul 2, 9:52 am)
Re: [PATCH 11/12] verify_path(): do not allow absolute paths, Steffen Prohaska, (Wed Jul 2, 10:20 am)
Re: [PATCH 11/12] verify_path(): do not allow absolute paths, Johannes Schindelin, (Wed Jul 2, 10:31 am)
Re: [PATCH] git-add--interactive: manual hunk editing mode, Junio C Hamano, (Wed Jul 2, 11:27 am)
Re: [msysGit] [PATCH 03/12] MinGW: Convert CR/LF to LF in ..., Johannes Schindelin, (Thu Jul 3, 4:08 am)
Re: [msysGit] [PATCH 06/12] connect: Fix custom ports with ..., Johannes Schindelin, (Thu Jul 3, 4:10 am)
Re: [PATCH 1/2] help.c: Add support for htmldir relative t ..., Johannes Schindelin, (Fri Jul 4, 5:35 am)
Re: [PATCH 1/2] help.c: Add support for htmldir relative t ..., Steffen Prohaska, (Fri Jul 11, 12:27 am)
[PATCH 1/3] Move code interpreting path relative to exec-d ..., Steffen Prohaska, (Fri Jul 11, 12:28 am)
[PATCH 2/3] help.c: Add support for htmldir relative to gi ..., Steffen Prohaska, (Fri Jul 11, 12:28 am)
[PATCH 3/3] help (Windows): Display HTML in default browse ..., Steffen Prohaska, (Fri Jul 11, 12:28 am)
Re: [PATCH 3/3] help (Windows): Display HTML in default br ..., Steffen Prohaska, (Fri Jul 11, 12:35 am)
[PATCH 3/3 FIXED] help (Windows): Display HTML in default ..., Steffen Prohaska, (Fri Jul 11, 12:37 am)
[PATCH] Convert CR/LF to LF in tag signatures, Steffen Prohaska, (Fri Jul 11, 9:55 am)
Re: [PATCH] Fixed text file auto-detection: treat EOF char ..., Johannes Schindelin, (Fri Jul 11, 11:42 am)
Re: [PATCH] Fixed text file auto-detection: treat EOF char ..., Johannes Schindelin, (Fri Jul 11, 1:40 pm)
Re: [PATCH 3/3 FIXED] help (Windows): Display HTML in defa ..., Steffen Prohaska, (Fri Jul 11, 11:45 pm)