Commit 7483e08f by Simon Committed by Carlos Martín Nieto

Handle ssh:// and git:// urls containing a '~' character.

For such a path '/~/...' the leading '/' is stripped so the server will
get a path starting with '~' and correctly handle it.
parent a299d0af
......@@ -50,6 +50,8 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
}
repo = delim;
if (repo[1] == '~')
++repo;
delim = strchr(url, ':');
if (delim == NULL)
......
......@@ -66,6 +66,8 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
if (!git__prefixcmp(url, prefix_ssh)) {
url = url + strlen(prefix_ssh);
repo = strchr(url, '/');
if (repo && repo[1] == '~')
++repo;
} else {
repo = strchr(url, ':');
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