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.