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.
This commit is contained in:
Simon 2015-08-03 07:38:07 +01:00
parent c400bac4db
commit ac728c2483
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;
if (repo[1] == '~')
++repo;
delim = strchr(url, ':');
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)) {
url = url + strlen(prefix_ssh);
repo = strchr(url, '/');
if (repo && repo[1] == '~')
++repo;
} else {
repo = strchr(url, ':');
if (repo) repo++;