Skip to content

Commit 7dedd7f

Browse files
author
Mr. Outis
committed
tests/repo: bring back the old branch logic
1 parent d2469f7 commit 7dedd7f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/func/test_repo.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22

3+
from dvc.scm.git.tree import GitTree
34
from dvc.cache import Cache
45
from dvc.repo import Repo
56
from dvc.system import System
@@ -38,9 +39,19 @@ def collect_outs(*args, **kwargs):
3839

3940
tmp_dir.dvc_gen("foo", "foo")
4041
run_copy("foo", "bar")
41-
assert collect_outs("bar.dvc", with_deps=True) == {"foo", "bar"}
42+
scm.add([".gitignore", "foo.dvc", "bar.dvc"])
43+
scm.commit("Add foo and bar")
44+
45+
scm.checkout("new-branch", create_new=True)
4246

4347
run_copy("bar", "buzz")
48+
scm.add([".gitignore", "buzz.dvc"])
49+
scm.commit("Add buzz")
50+
51+
assert collect_outs("bar.dvc", with_deps=True) == {"foo", "bar"}
52+
53+
dvc.tree = GitTree(scm.repo, "new-branch")
54+
4455
assert collect_outs("buzz.dvc", with_deps=True) == {"foo", "bar", "buzz"}
4556
assert collect_outs("buzz.dvc", with_deps=False) == {"buzz"}
4657

0 commit comments

Comments
 (0)