Skip to content

Commit

Permalink
fixes iterative#8705 issue changes applied
Browse files Browse the repository at this point in the history
  • Loading branch information
karanjakhar committed Feb 13, 2023
1 parent 487dc7a commit 21ba6b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dvc/cachemgr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from dvc.fs import GitFileSystem, LocalFileSystem, Schemes
from dvc_data.hashfile.db import get_odb

Expand All @@ -14,9 +16,13 @@ def _get_odb(repo, settings, fs=None):
if (
isinstance(repo.fs, GitFileSystem)
and isinstance(fs, LocalFileSystem)
and fs_path[:-10] == "/"
and not os.path.isdir(fs_path)
):
fs_path = fs.path.join(repo.abs_root_dir, fs_path[1:])
seps = os.sep + os.altsep if os.altsep else os.sep
fs_path = os.path.join(
repo.abs_root_dir, os.path.splitdrive(fs_path)[1].lstrip(seps)
)

return get_odb(fs, fs_path, state=repo.state, **config)


Expand Down

0 comments on commit 21ba6b5

Please sign in to comment.