tests: func test for #4344 (#10732)

See https://github.com/iterative/dvc-data/pull/601 that fixed the issue.
The test is based on reproduction steps from:
https://github.com/iterative/dvc/issues/4344#issuecomment-2822000925
This commit is contained in:
skshetry
2025-04-29 13:25:28 +05:45
committed by GitHub
parent bd65c205df
commit 88f1ada4bf
+9
View File
@@ -744,3 +744,12 @@ def test_checkout_dir_compat(tmp_dir, dvc):
remove("data")
dvc.checkout()
assert (tmp_dir / "data").read_text() == {"foo": "foo"}
def test_checkout_cleanup_properly_on_untracked_nested_directories(tmp_dir, scm, dvc):
tmp_dir.dvc_gen({"datasets": {"dir1": {"file1": "file1"}}})
tmp_dir.gen({"datasets": {"dir2": {"dir3": {"file2": "file2"}}}})
dvc.checkout(force=True)
assert (tmp_dir / "datasets").read_text() == {"dir1": {"file1": "file1"}}