From 7dedd7f518a9487b67728f8333d50a2378ce87bc Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Tue, 17 Dec 2019 12:12:57 -0600 Subject: [PATCH] tests/repo: bring back the old branch logic --- tests/func/test_repo.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/func/test_repo.py b/tests/func/test_repo.py index 92d70e305..bb278d273 100644 --- a/tests/func/test_repo.py +++ b/tests/func/test_repo.py @@ -1,5 +1,6 @@ import os +from dvc.scm.git.tree import GitTree from dvc.cache import Cache from dvc.repo import Repo from dvc.system import System @@ -38,9 +39,19 @@ def test_collect(tmp_dir, scm, dvc, run_copy): tmp_dir.dvc_gen("foo", "foo") run_copy("foo", "bar") - assert collect_outs("bar.dvc", with_deps=True) == {"foo", "bar"} + scm.add([".gitignore", "foo.dvc", "bar.dvc"]) + scm.commit("Add foo and bar") + + scm.checkout("new-branch", create_new=True) run_copy("bar", "buzz") + scm.add([".gitignore", "buzz.dvc"]) + scm.commit("Add buzz") + + assert collect_outs("bar.dvc", with_deps=True) == {"foo", "bar"} + + dvc.tree = GitTree(scm.repo, "new-branch") + assert collect_outs("buzz.dvc", with_deps=True) == {"foo", "bar", "buzz"} assert collect_outs("buzz.dvc", with_deps=False) == {"buzz"}