Skip to content

Commit c43d203

Browse files
codexByron
authored andcommitted
Avoid loose-object mapping in Windows regression test
The Python 3.7 Windows package check passed the custom object-directory assertions but failed while TemporaryDirectory removed the loose object, because GitDB's info lookup left the file mapped during cleanup. Use GitDB's existing has_object lookup to verify Python ODB discovery without opening the loose object. The git cat-file assertion continues to validate the payload and preserved subprocess environment. Validation: focused pytest; Ruff check and format; mypy; compileall; git diff --check.
1 parent c270a04 commit c43d203

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/test_repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def test_repo_discovery_preserves_object_directory(self):
289289

290290
with repo:
291291
assert osp.samefile(repo.odb.root_path(), object_dir)
292-
assert repo.odb.info(bytes.fromhex(blob_hexsha)).size == len(payload)
292+
assert repo.odb.has_object(bytes.fromhex(blob_hexsha))
293293
assert repo.git.cat_file("blob", blob_hexsha) == payload.decode()
294294
repo.alternates = ["other/location"]
295295
assert repo.alternates == ["other/location"]

0 commit comments

Comments
 (0)