checkout: don't filter hash's if it is a file (#5298)

This commit is contained in:
Batuhan Taskaya
2021-01-20 12:36:47 +02:00
committed by GitHub
parent c6ce69dd30
commit b5068a9200
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -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)
+11
View File
@@ -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"]