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

umputun / revdiff / 24055872851

06 Apr 2026 11:14PM UTC coverage: 91.116% (-0.05%) from 91.169%
24055872851

push

github

web-flow
Detect binary files in diff with size delta and IsBinary flag (#44)

* Detect binary files in diff and show placeholder with file size delta

Binary files in git diffs previously showed as blank (no content) because
ParseUnifiedDiff never found hunk headers for them. Now detects git's
"Binary files ... differ" marker and returns a placeholder enriched with
size info from git diff --stat (e.g. "(binary file: 1.0 KB → 2.0 KB)").

* Add IsBinary field and header-based new/deleted detection for binary diffs

Replace fragile string comparison (Content == BinaryPlaceholder) with an
explicit IsBinary bool on DiffLine. ParseUnifiedDiff now tracks "new file
mode" / "deleted file mode" from diff headers so the placeholder content
is correct even when git diff --stat fails (e.g. non-English locale).
Also clarifies locale assumptions in binaryStatRe and binaryFilesRe
comments and uses binaryChangeKind for accurate create/delete detection
when stat parsing succeeds.

* Refine binary diff helpers

79 of 89 new or added lines in 2 files covered. (88.76%)

4154 of 4559 relevant lines covered (91.12%)

460.74 hits per line

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

89.8
/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