Skip to content

Commit 963ca1c

Browse files
committed
test(stats): avoid normalizing fixture paths on Windows
The stats regression's root and modification assertions pass on Windows, but IndexFile.remove normalizes the all-space test path to `.` and makes `git rm` fail before testing deletion statistics. Clear and write the fixture's in-memory index instead, just as the test already stores its initial blobs directly. The resulting empty-tree commit still exercises deletion statistics for every original filename. The full Linux suite again passes: 1690 passed, 89 skipped, 1 xfailed, and 64 subtests. Focused commit/util/diff tests, pre-commit, mypy, and basedpyright pass. Windows CI will verify the portability correction. Prepared by OpenAI Codex (dot); human review is pending.
1 parent 3e9611b commit 963ca1c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎test/test_commit.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ def test_stats_preserve_filename_spaces(self, rw_dir):
189189
assert empty_stats.files == {}
190190
assert empty_stats.total == {"insertions": 0, "deletions": 0, "lines": 0, "files": 0}
191191

192-
repo.index.remove(list(paths))
192+
# Avoid filesystem path normalization of space-only names on Windows.
193+
index = repo.index
194+
index.entries.clear()
195+
index.write()
193196
removed_stats = repo.index.commit("Remove files", author=actor, committer=actor).stats
194197
assert removed_stats.files == {
195198
path: {"insertions": 0, "deletions": 2 * count, "lines": 2 * count, "change_type": "D"}

0 commit comments

Comments
 (0)