Steffen Prohaska wrote:
> Can you send a patch?

commit 1dca1849a2ffeeaead4d4675e1e0de3989d6b3b4
Author: Edward Z. Yang <[EMAIL PROTECTED]>
Date:   Sun Jun 15 15:52:36 2008 -0400

    Fix custom ports with plink
    
    PuTTY requires -P while OpenSSH requires -p; if plink is detected
    as GIT_SSH, use the alternate flag.
    
    Signed-off-by: Edward Z. Yang <[EMAIL PROTECTED]>

diff --git a/connect.c b/connect.c
index 8d600c9..e399492 100644
--- a/connect.c
+++ b/connect.c
@@ -595,14 +595,17 @@ struct child_process *git_connect(int fd[2], const char 
*url_orig,
                die("command line too long");
 
        conn->in = conn->out = -1;
+       /* be sure to increase this size if you add more args */
        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;

Reply via email to