mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
checkout: don't filter hash's if it is a file (#5298)
This commit is contained in:
Vendored
+1
-1
@@ -92,7 +92,7 @@ class CloudCache:
|
||||
return DirInfo.from_list(d)
|
||||
|
||||
def _filter_hash_info(self, hash_info, path_info, filter_info):
|
||||
if not filter_info:
|
||||
if not filter_info or path_info == filter_info:
|
||||
return hash_info
|
||||
|
||||
dir_info = self.get_dir_cache(hash_info)
|
||||
|
||||
@@ -974,3 +974,14 @@ def test_checkout_partial_subdir(tmp_dir, dvc):
|
||||
"foo": "foo",
|
||||
"sub_dir": {"bar": "bar", "baz": "baz"},
|
||||
}
|
||||
|
||||
|
||||
def test_checkout_file(tmp_dir, dvc):
|
||||
tmp_dir.dvc_gen("foo", "foo")
|
||||
|
||||
stats = dvc.checkout("foo")
|
||||
assert not any(stats.values())
|
||||
|
||||
os.unlink("foo")
|
||||
stats = dvc.checkout("foo")
|
||||
assert stats["added"] == ["foo"]
|
||||
|
||||
Reference in New Issue
Block a user