Fix dvc add -o issue #7357

This commit is contained in:
Zhenyu Gao
2022-02-28 15:24:16 +01:00
committed by daniele
parent 4c71aadc21
commit a378e017e1
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -404,6 +404,7 @@ class Stage(params.StageParams):
out.transfer(source, odb=odb, jobs=kwargs.get("jobs"))
if not to_remote:
out.checkout()
out.ignore()
@rwlocked(read=["deps"], write=["outs"])
def reproduce(self, interactive=False, **kwargs):
+7
View File
@@ -1033,6 +1033,13 @@ def test_add_to_cache_file(tmp_dir, dvc, local_cloud):
assert foo.read_text() == "foo"
def test_add_with_out(tmp_dir, scm, dvc):
tmp_dir.gen({"foo": "foo"})
dvc.add("foo", out="out_foo")
gitignore_content = get_gitignore_content()
assert "/out_foo" in gitignore_content
def test_add_to_cache_different_name(tmp_dir, dvc, local_cloud):
local_cloud.gen({"data": {"foo": "foo", "bar": "bar"}})