diff -r 9519312ecd81 -r ebb13f9a9ba8 mercurial/hg.py --- a/mercurial/hg.py Sun Apr 11 19:18:54 2021 +0200 +++ b/mercurial/hg.py Wed Apr 14 10:35:40 2021 +0200 @@ -672,8 +672,8 @@ """ if isinstance(source, bytes): - origsource = ui.expandpath(source) - source, branches = urlutil.parseurl(origsource, branch) + src = urlutil.get_clone_path(ui, source, branch) + origsource, source, branches = src srcpeer = peer(ui, peeropts, source) else: srcpeer = source.peer() # in case we were called with a localrepo