tests: add a regression test for #10959 (#10960)

This commit is contained in:
skshetry
2026-01-08 21:14:22 +05:45
committed by GitHub
parent ff8752c3dc
commit 0f73c0a725
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ dependencies = [
"distro>=1.3", "distro>=1.3",
"dpath<3,>=2.1.0", "dpath<3,>=2.1.0",
"dulwich", "dulwich",
"dvc-data>=3.18.0,<3.19.0", "dvc-data>=3.18.1,<3.19.0",
"dvc-http>=2.29.0", "dvc-http>=2.29.0",
"dvc-objects", "dvc-objects",
"dvc-render>=1.0.1,<2", "dvc-render>=1.0.1,<2",
+24
View File
@@ -1244,3 +1244,27 @@ def test_shallow_should_iterate_upto_tracked_directory(tmp_dir, dvc, scm, local_
"committed": {"added": M.unordered(*files)}, "committed": {"added": M.unordered(*files)},
"git": M.dict(), "git": M.dict(),
} }
def test_duplicate_hashes_not_in_remote(tmp_dir, dvc, scm, local_remote):
"""Test that files with identical content (same hash) are all correctly reported.
Regression test for https://github.com/iterative/dvc/issues/10959
"""
tmp_dir.dvc_gen(
{"foo": "content", "bar": "content", "foobar": "foobar"}, commit="add files"
)
assert dvc.data_status(not_in_remote=True, granular=True, remote_refresh=True) == {
**EMPTY_STATUS,
"unchanged": M.unordered("foo", "bar", "foobar"),
"not_in_remote": M.unordered("foo", "bar", "foobar"),
"git": M.dict(),
}
dvc.push()
assert dvc.data_status(not_in_remote=True, granular=True, remote_refresh=True) == {
**EMPTY_STATUS,
"unchanged": M.unordered("foo", "bar", "foobar"),
"not_in_remote": [],
"git": M.dict(),
}