• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / revdiff / 24852531119

23 Apr 2026 06:41PM UTC coverage: 89.355% (-0.2%) from 89.581%
24852531119

Pull #146

github

umputun
fix(diff): use sawHunk flag to guard trailing divider emission

Replaces the prevOldEnd > 1 guard with an explicit sawHunk boolean. The
previous guard conflated "did we process any hunk" with "did the last hunk
end past line 1", so a hypothetical `@@ -0,0 +1,N @@` hunk alongside
totalOldLines > 0 would suppress the trailing divider even though the
hunk was processed (prevOldEnd stays at 1 for that case: 0 + max(0,1) = 1,
the same as the initial value).

Adds a test locking in the behavior. The practical impact is nil today
(git/hg/jj only emit @@ -0,0 on genuinely new files where totalOldLines=0
and the outer guard already skips), but the cleaner guard documents intent
and avoids future surprises.

Addresses Copilot inline review on #146.
Pull Request #146: feat(diff): line-count labels on compact-mode dividers (⋯ N lines ⋯)

75 of 107 new or added lines in 3 files covered. (70.09%)

8251 of 9234 relevant lines covered (89.35%)

454.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.23
/app/diff/diff.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc