X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=connect.c;h=20054e4d0fd4cf94288593726be179d07d19271c;hb=720c9f7bda20d8f307745772374647c1a2076b3d;hp=db965c9982f1f2ae7e08331d3fa1d40e194a6520;hpb=ff86bdd5cac70850eea4791bea78efa19b228ebe;p=git.git diff --git a/connect.c b/connect.c index db965c998..20054e4d0 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 '[]' dewrapping 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;