Commit 3cf4eb09 by Carlos Martín Nieto

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

Handle ssh:// and git:// urls containing a '~' character.
parents c400bac4 ac728c24
...@@ -50,6 +50,8 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url) ...@@ -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)
......
...@@ -66,6 +66,8 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url) ...@@ -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++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment