Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-08-03 11:29:17 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-08-03 11:29:17 +0300
commit3cf4eb0922f8a495f04fe6da1e33d1802e700879 (patch)
tree64ce3ea4fa99f029fcd4824c6ee6a371b0e453b3
parentc400bac4db12d8be95f1876d16231743b5696244 (diff)
parentac728c248361df6ab8c23d8c5cfece7391c871db (diff)
Merge pull request #3348 from MrHacky/remote-path-with-tilde
Handle ssh:// and git:// urls containing a '~' character.
-rw-r--r--src/transports/git.c2
-rw-r--r--src/transports/ssh.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/transports/git.c b/src/transports/git.c
index 7e0a47414..52de92d09 100644
--- a/src/transports/git.c
+++ b/src/transports/git.c
@@ -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)
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 0b0d4bac3..8f5a7164b 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -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++;