X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=connect.c;h=02e738a0146a5c46aaf3f1d8edc3c055a99e98b9;hb=5bfd53629e93113a17fe7d6a7a24554dc3c17cdb;hp=fc8f15502807a2bcb4e4cd1d358b5ac0befb8853;hpb=4b05548fc0523744b7a1276cfa0f4aae19d6d9c9;p=git.git diff --git a/connect.c b/connect.c index fc8f15502..02e738a01 100644 --- a/connect.c +++ b/connect.c @@ -5,6 +5,7 @@ #include "refs.h" #include "run-command.h" #include "remote.h" +#include "url.h" static char *server_capabilities; @@ -450,7 +451,7 @@ static struct child_process no_fork; struct child_process *git_connect(int fd[2], const char *url_orig, const char *prog, int flags) { - char *url = xstrdup(url_orig); + char *url; char *host, *path; char *end; int c; @@ -466,6 +467,11 @@ struct child_process *git_connect(int fd[2], const char *url_orig, */ signal(SIGCHLD, SIG_DFL); + if (is_url(url_orig)) + url = url_decode(url_orig); + else + url = xstrdup(url_orig); + host = strstr(url, "://"); if (host) { *host = '\0';