summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAntoine Pelisse <apelisse@gmail.com>2013-08-09 17:13:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-08-09 22:33:02 (GMT)
commit33f66b25e1880db9d5b2f665b42d5e867d118b38 (patch)
tree83fa251ed09803968fe8418b5f8ed7ce7bf6fb67 /contrib
parentb48493e937bb46d352336e2918e37120fe1d352d (diff)
downloadgit-33f66b25e1880db9d5b2f665b42d5e867d118b38.zip
git-33f66b25e1880db9d5b2f665b42d5e867d118b38.tar.gz
git-33f66b25e1880db9d5b2f665b42d5e867d118b38.tar.bz2
remote-hg: fix path when cloning with tilde expansion
The current code fixes the path to make it absolute when cloning, but doesn't consider tilde expansion, so that scenario fails throwing an exception because /home/myuser/~/my/repository doesn't exists: $ git clone hg::~/my/repository && cd repository && git fetch Expand the tilde when checking if the path is absolute, so that we don't fix a path that doesn't need to be. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 0194c67..81ca001 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -1124,7 +1124,7 @@ def do_option(parser):
def fix_path(alias, repo, orig_url):
url = urlparse.urlparse(orig_url, 'file')
- if url.scheme != 'file' or os.path.isabs(url.path):
+ if url.scheme != 'file' or os.path.isabs(os.path.expanduser(url.path)):
return
abs_url = urlparse.urljoin("%s/" % os.getcwd(), orig_url)
cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % abs_url]