fix(commit): count files for a root commit with diff-tree --root #458
No reviewers
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea!458
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-454-root-commit-stats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
madt_commit printed "(0 file(s), +0 -0)" for the first commit in a fresh repo, even when the commit contained files.
git diff-tree --shortstat <ref>emits nothing for a root commit (it compares against a parent, and a root commit has none), so the stat regexes matched nothing and CommitStats stayed all-zero. Add --root so diff-tree shows a parentless commit as a diff against the empty tree; it is a no-op once a commit has a parent, so every other case is unchanged. The commit content was always correct - this fixes the confirmation line only. Adds TestGetCommitStats_RootCommit covering the root commit and a following non-root commit.Closes #454