remote-hg: fix path when cloning with tilde expansion
[gitweb.git] / contrib / remote-helpers / git-remote-hg
index 0194c67fb1db1dc6fdd4bd90b67d04cfb7a34e1d..81ca001c3b21da9e936f3e70487a5b65f3ee288f 100755 (executable)
@@ -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]