Merge pull request #3348 from MrHacky/remote-path-with-tilde

Handle ssh:// and git:// urls containing a '~' character.
This commit is contained in:
Carlos Martín Nieto 2015-08-03 10:29:17 +02:00
commit 3cf4eb0922
2 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,8 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
} }
repo = delim; repo = delim;
if (repo[1] == '~')
++repo;
delim = strchr(url, ':'); delim = strchr(url, ':');
if (delim == NULL) if (delim == NULL)

View File

@ -66,6 +66,8 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
if (!git__prefixcmp(url, prefix_ssh)) { if (!git__prefixcmp(url, prefix_ssh)) {
url = url + strlen(prefix_ssh); url = url + strlen(prefix_ssh);
repo = strchr(url, '/'); repo = strchr(url, '/');
if (repo && repo[1] == '~')
++repo;
} else { } else {
repo = strchr(url, ':'); repo = strchr(url, ':');
if (repo) repo++; if (repo) repo++;