Correctly detect Plink.exe, and avoid passing -batch to TortoisePlink

On Windows, file names are case-insensitive, and some versions of
TortoisePlink do not handle -batch well (i.e. they do not understand,
neither ignore it).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2009-05-20 13:42:04 +02:00
parent b078c82afd
commit ac3f43986a

View File

@@ -605,11 +605,11 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
conn->argv = arg = xcalloc(7, sizeof(*arg));
if (protocol == PROTO_SSH) {
const char *ssh = getenv("GIT_SSH");
int putty = ssh && strstr(ssh, "plink");
int putty = ssh && strcasestr(ssh, "plink");
if (!ssh) ssh = "ssh";
*arg++ = ssh;
if (putty)
if (putty && !strcasestr(ssh, "tortoiseplink"))
*arg++ = "-batch";
if (port) {
/* P is for PuTTY, p is for OpenSSH */