You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(diff): correct truncation overflow count in condense_unified_diff
The overflow message "+N more" in condense_unified_diff was lying.
The `changes` vec was capped at 15 entries, so `changes.len() - 10`
could only reach 5 — reporting "+5 more" when 190 lines were actually
truncated. Fix: track `added + removed` directly and compute true
overflow as `(added + removed) - 10`.
Adds 7 accuracy tests across 4 modules to lock in correct overflow
reporting:
- diff_cmd: overflow count matches true total (200 changes → "+190 more")
- diff_cmd: no spurious overflow message for 8 changes
- git: format_status overflow count is exact (25 staged → "+10 more")
- git: compact_diff recovery hint present when hunk is truncated
- grep: documents uncapped-vector invariant that prevents the diff bug
- filter: smart_truncate kept + reported_more == total_lines
Closes the test gap flagged in testing-patterns.md backlog for diff_cmd.rs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
0 commit comments