Skip to content

Commit

Permalink
repo.open_repo: use abspath for local fs URL
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Jul 4, 2023
1 parent 4d467f0 commit edc303b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions dvc/repo/open_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def open_repo(url, *args, **kwargs):
url = os.getcwd()

if os.path.exists(url):
url = os.path.abspath(url)
try:
config = _get_remote_config(url)
config.update(kwargs.get("config") or {})
Expand Down
2 changes: 2 additions & 0 deletions tests/func/api/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ def test_get_url_subrepos(tmp_dir, scm, local_cloud):
local_cloud / "files" / "md5" / "ac" / "bd18db4cc2f85cedef654fccc4a4d8"
)
assert api.get_url(os.path.join("subrepo", "dir", "foo")) == expected_url
assert api.get_url(os.path.join("subrepo", "dir", "foo"), repo=".") == expected_url

expected_url = os.fspath(
local_cloud / "files" / "md5" / "37" / "b51d194a7513e45b56f6524f2d51f2"
)
assert api.get_url("subrepo/bar") == expected_url
assert api.get_url("subrepo/bar", repo=".") == expected_url


def test_open_from_remote(tmp_dir, erepo_dir, cloud, local_cloud):
Expand Down

0 comments on commit edc303b

Please sign in to comment.