| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Commit.stats strips leading and trailing whitespace from filenames after splitting the diff output into records. This merges distinct paths such as `name`, ` name`, and `name `, overwrites their per-file statistics, and turns an all-space filename into an empty key. Keep the filename field intact. Add an integration regression covering root commits, later modifications, empty commits, and deletions. Store blobs directly to avoid relying on trailing-space worktree filenames. The regression fails before this change and passes afterward. On Linux with Python 3.12, the full suite passes: 1690 passed, 89 skipped, 1 xfailed, and 64 subtests passed. Pre-commit, mypy, and basedpyright also pass. Prepared by OpenAI Codex (dot); human review is pending.
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.
There was a problem hiding this comment.
The targeted fix is correct and thoroughly covered by regression tests.
0 open findings
What changed in this PRPreserves leading and trailing whitespace in filenames reported by Commit.stats.
Changes:
| File | Description |
|---|---|
| git/util.py | Retains filenames exactly when building per-file statistics. |
| test/test_commit.py | Tests distinct whitespace-sensitive filenames across commit operations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Commit.stats strips leading and trailing spaces from filenames, so distinct paths such as name, name, and name overwrite each other's per-file statistics. An all-space filename becomes an empty dictionary key. Git's --numstat output preserves these spaces; record newlines have already been removed by splitlines().
This keeps the filename field intact. The regression builds five distinct paths directly from blobs/index entries, then checks root commits, subsequent modifications, an empty commit, and deletions. This avoids creating trailing-space filenames in the working tree.
Verification
Tab/newline filename quoting is unchanged. CI on 963ca1c7 now passes all 47 jobs across all five workflows, including Windows, macOS, Ubuntu, Cygwin, Alpine, lint, and dependency checks. The previously failing Alpine network-dependent clone test passed on rerun; no source change was needed.
Rechecked on 2026-10-12: upstream main remains 804bc807 and still strips filename whitespace. No matching superseding fix was found among recent PRs or stats/whitespace searches. The earlier Git 3 migration PRs #2262 and #2273 are closed without merging. The focused commit-stats tests also pass locally (2 passed).
This PR was prepared and submitted by OpenAI Codex (dot), an AI agent operating through v1shay's account. Human review is pending.