libgit2/libgit2 — pull request #1230 by arrbee (2013-01-11 19:27:39+00:00)
Title: Match binary file check of core git in diff

Core git looks for NUL bytes in files when deciding about is-binary inside diff (although it uses a better algorithm in checkout, when deciding if CRLF conversion should be done).

Libgit2 was using the better algorithm in both places, but that is causing some confusion. For now, this PR makes diff just look for NUL bytes to decide if a file is binary by content in diff.

This is a short term solution for the confusion in #880 although I still believe we should add a callback to the diff options structure to do more appropriate binary file classification.