diff --git a/dvc/odbmgr.py b/dvc/odbmgr.py index d17291208..ee3d6d524 100644 --- a/dvc/odbmgr.py +++ b/dvc/odbmgr.py @@ -1,8 +1,8 @@ -from dvc.fs import Schemes +from dvc.fs import GitFileSystem, Schemes from dvc_data.db import get_odb -def _get_odb(repo, settings): +def _get_odb(repo, settings, fs=None): from dvc.fs import get_cloud_fs if not settings: @@ -10,7 +10,8 @@ def _get_odb(repo, settings): cls, config, fs_path = get_cloud_fs(repo, **settings) config["tmp_dir"] = repo.tmp_dir - return get_odb(cls(**config), fs_path, state=repo.state, **config) + fs = fs or cls(**config) + return get_odb(fs, fs_path, state=repo.state, **config) class ODBManager: @@ -42,7 +43,11 @@ class ODBManager: if opt in config: settings[str(opt)] = config.get(opt) - odb = _get_odb(repo, settings) + kwargs = {} + if not isinstance(repo.fs, GitFileSystem): + kwargs["fs"] = repo.fs + + odb = _get_odb(repo, settings, **kwargs) self._odb["repo"] = odb self._odb[Schemes.LOCAL] = odb diff --git a/dvc/output.py b/dvc/output.py index 8cbf227c2..38b20898e 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -341,9 +341,6 @@ class Output: self.remote = remote def _parse_path(self, fs, fs_path): - if fs.protocol != "local": - return fs_path - parsed = urlparse(self.def_path) if parsed.scheme != "remote": # NOTE: we can path either from command line or .dvc file, @@ -386,9 +383,6 @@ class Output: @property def is_in_repo(self): - if self.fs.protocol != "local": - return False - if urlparse(self.def_path).scheme == "remote": return False