mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
Merge pull request #1611 from efiop/master
ssh: handle url without path
This commit is contained in:
+1
-1
@@ -70,7 +70,7 @@ class RemoteSSH(RemoteBase):
|
||||
or parsed.username
|
||||
or getpass.getuser()
|
||||
)
|
||||
self.prefix = parsed.path
|
||||
self.prefix = parsed.path or "/"
|
||||
self.port = (
|
||||
config.get(Config.SECTION_REMOTE_PORT)
|
||||
or parsed.port
|
||||
|
||||
@@ -51,6 +51,11 @@ class TestRemoteSSH(TestCase):
|
||||
self.assertEqual(remote.port, remote.DEFAULT_PORT)
|
||||
self.assertEqual(remote.prefix, path)
|
||||
|
||||
def test_no_path(self):
|
||||
config = {"url": "ssh://127.0.0.1"}
|
||||
remote = RemoteSSH(None, config)
|
||||
self.assertEqual(remote.prefix, "/")
|
||||
|
||||
def test_port(self):
|
||||
url = "ssh://127.0.0.1/path/to/dir"
|
||||
config = {"url": url}
|
||||
|
||||
Reference in New Issue
Block a user