X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=connect.c;h=76e542776abff8d07e7250ecfc8c7ae813302b2d;hb=6d71c1dca4396de545a6c9667b3dcf0c03e42b30;hp=958c831e430340435c31b640bd757d56b7cb8b71;hpb=39836a2e3cc38735d532a08465774194e5099daf;p=git.git diff --git a/connect.c b/connect.c index 958c831e4..76e542776 100644 --- a/connect.c +++ b/connect.c @@ -464,7 +464,7 @@ static void git_proxy_connect(int fd[2], char *host) #define MAX_CMD_LEN 1024 -char *get_port(char *host) +static char *get_port(char *host) { char *end; char *p = strchr(host, ':'); @@ -605,14 +605,18 @@ struct child_process *git_connect(int fd[2], const char *url_orig, die("command line too long"); conn->in = conn->out = -1; - conn->argv = arg = xcalloc(6, sizeof(*arg)); + conn->argv = arg = xcalloc(7, sizeof(*arg)); if (protocol == PROTO_SSH) { const char *ssh = getenv("GIT_SSH"); + int putty = ssh && strcasestr(ssh, "plink"); if (!ssh) ssh = "ssh"; *arg++ = ssh; + if (putty && !strcasestr(ssh, "tortoiseplink")) + *arg++ = "-batch"; if (port) { - *arg++ = "-p"; + /* P is for PuTTY, p is for OpenSSH */ + *arg++ = putty ? "-P" : "-p"; *arg++ = port; } *arg++ = host;