From 0f73c0a7255642b59dc4ab867b50c1080829dcb3 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Thu, 8 Jan 2026 21:14:22 +0545 Subject: [PATCH] tests: add a regression test for #10959 (#10960) --- pyproject.toml | 2 +- tests/func/test_data_status.py | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6b4ee30d8..80db4365f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dependencies = [ "distro>=1.3", "dpath<3,>=2.1.0", "dulwich", - "dvc-data>=3.18.0,<3.19.0", + "dvc-data>=3.18.1,<3.19.0", "dvc-http>=2.29.0", "dvc-objects", "dvc-render>=1.0.1,<2", diff --git a/tests/func/test_data_status.py b/tests/func/test_data_status.py index a73ebedc4..a3799ec68 100644 --- a/tests/func/test_data_status.py +++ b/tests/func/test_data_status.py @@ -1244,3 +1244,27 @@ def test_shallow_should_iterate_upto_tracked_directory(tmp_dir, dvc, scm, local_ "committed": {"added": M.unordered(*files)}, "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(), + }