mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 11:19:47 +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;
|
||||
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++;
|
||||
|
Loading…
Reference in New Issue
Block a user