diff --git a/dvc/repo/stage.py b/dvc/repo/stage.py index 0f44ae76d..43d477e18 100644 --- a/dvc/repo/stage.py +++ b/dvc/repo/stage.py @@ -96,7 +96,10 @@ def locked(f): class StageLoad: def __init__(self, repo: "Repo") -> None: self.repo: "Repo" = repo - self.fs = repo.fs + + @property + def fs(self): + return self.repo.fs @locked def add( diff --git a/tests/func/test_repo_index.py b/tests/func/test_repo_index.py index 5145080f0..281e2e164 100644 --- a/tests/func/test_repo_index.py +++ b/tests/func/test_repo_index.py @@ -296,6 +296,16 @@ def test_view_combined_filter(tmp_dir, scm, dvc, run_copy): } +def test_view_brancher(tmp_dir, scm, dvc): + tmp_dir.dvc_gen({"foo": "foo"}, commit="init") + index = Index.from_repo(dvc) + + for _ in dvc.brancher(revs=["HEAD"]): + view = index.targets_view("foo") + data = view.data["repo"] + assert data[("foo",)] + + def test_with_gitignore(tmp_dir, dvc, scm): (stage,) = tmp_dir.dvc_gen({"data": {"foo": "foo", "bar": "bar"}})