Skip to content

Commit 0f73c0a

Browse files
authored
tests: add a regression test for #10959 (#10960)
1 parent ff8752c commit 0f73c0a

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies = [
4141
"distro>=1.3",
4242
"dpath<3,>=2.1.0",
4343
"dulwich",
44-
"dvc-data>=3.18.0,<3.19.0",
44+
"dvc-data>=3.18.1,<3.19.0",
4545
"dvc-http>=2.29.0",
4646
"dvc-objects",
4747
"dvc-render>=1.0.1,<2",

tests/func/test_data_status.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,3 +1244,27 @@ def test_shallow_should_iterate_upto_tracked_directory(tmp_dir, dvc, scm, local_
12441244
"committed": {"added": M.unordered(*files)},
12451245
"git": M.dict(),
12461246
}
1247+
1248+
1249+
def test_duplicate_hashes_not_in_remote(tmp_dir, dvc, scm, local_remote):
1250+
"""Test that files with identical content (same hash) are all correctly reported.
1251+
1252+
Regression test for https://github.com/iterative/dvc/issues/10959
1253+
"""
1254+
tmp_dir.dvc_gen(
1255+
{"foo": "content", "bar": "content", "foobar": "foobar"}, commit="add files"
1256+
)
1257+
assert dvc.data_status(not_in_remote=True, granular=True, remote_refresh=True) == {
1258+
**EMPTY_STATUS,
1259+
"unchanged": M.unordered("foo", "bar", "foobar"),
1260+
"not_in_remote": M.unordered("foo", "bar", "foobar"),
1261+
"git": M.dict(),
1262+
}
1263+
1264+
dvc.push()
1265+
assert dvc.data_status(not_in_remote=True, granular=True, remote_refresh=True) == {
1266+
**EMPTY_STATUS,
1267+
"unchanged": M.unordered("foo", "bar", "foobar"),
1268+
"not_in_remote": [],
1269+
"git": M.dict(),
1270+
}

0 commit comments

Comments
 (0)