X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=connect.c;h=a37cf6af0428023d2d3ef01ab2e04fc462981af4;hb=0901d5a2ef80996cf64c8afeaec765e1bc09f795;hp=db965c9982f1f2ae7e08331d3fa1d40e194a6520;hpb=0c15da68e819183fcf85f45daa25965b6fde86cc;p=git.git diff --git a/connect.c b/connect.c index db965c998..a37cf6af0 100644 --- a/connect.c +++ b/connect.c @@ -502,12 +502,18 @@ struct child_process *git_connect(int fd[2], const char *url_orig, c = ':'; } + /* + * Don't do destructive transforms with git:// as that + * protocol code does '[]' unwrapping of its own. + */ if (host[0] == '[') { end = strchr(host + 1, ']'); if (end) { - *end = 0; + if (protocol != PROTO_GIT) { + *end = 0; + host++; + } end++; - host++; } else end = host; } else @@ -613,8 +619,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig, NULL }; conn->env = env; - *arg++ = "sh"; - *arg++ = "-c"; + conn->use_shell = 1; } *arg++ = cmd.buf; *arg = NULL;