we remove scp style, also remove it for tilde expansion, fixes #6856

This commit is contained in:
Thomas Waldmann 2022-07-13 16:42:46 +02:00
parent ca74118b61
commit 1de12eacb7
1 changed files with 0 additions and 5 deletions

View File

@ -332,15 +332,10 @@ class RepositoryServer: # pragma: no cover
def _resolve_path(self, path):
if isinstance(path, bytes):
path = os.fsdecode(path)
# Leading slash is always present with URI (ssh://), but not with short-form (who@host:path).
if path.startswith("/~/"): # /~/x = path x relative to home dir
path = os.path.join(get_base_dir(), path[3:])
elif path.startswith("~/"):
path = os.path.join(get_base_dir(), path[2:])
elif path.startswith("/~"): # /~username/x = relative to "user" home dir
path = os.path.expanduser(path[1:])
elif path.startswith("~"):
path = os.path.expanduser(path)
elif path.startswith("/./"): # /./x = path x relative to cwd
path = path[3:]
return os.path.realpath(path)