mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 13:25:18 +00:00
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:
parent
c400bac4db
commit
ac728c2483
@ -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)
|
|||||||
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++;
|
||||||
|
Loading…
Reference in New Issue
Block a user