File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11import os
22
3+ from dvc .scm .git .tree import GitTree
34from dvc .cache import Cache
45from dvc .repo import Repo
56from 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
You can’t perform that action at this time.
0 commit comments