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
{{ message }}
Repository navigation
Line-ending check: catch UTF-16 text that Git treats as binary #57
tools/ci/check_line_endings.py rejects files that git ls-files --eol reports as i/crlf or i/mixed. A file Git classifies as binary by content is reported as i/-text and passes, and that includes UTF-16 text (every ASCII character is followed by a NUL byte), with CR LF inside. Windows PowerShell 5.1 writes UTF-16 with CR LF by default (> and Out-File), so such a file is easy to commit by accident.
Nothing breaks today: the maps and vectors whose bytes matter are checked by SHA-256 in their own tests. It is only the UTF-8 / LF convention that can slip.
To do
For i/-text entries whose extension is not on a short list of real binary types, read the first bytes and fail on a UTF-16 / UTF-32 byte-order mark or on CR LF.
A CPU test: a temporary git repository with a UTF-16 CR LF .txt and a .png; the script must fail for the first file only.
Activity