libgit2/libgit2 — pull request #1149 by nulltoken (2012-12-17 18:07:09+00:00)
Title: Introduce git_blob_is_binary()

Determine if the blob content is most certainly binary or not.

The heuristic used to guess if a file is binary is taken from core git: Searching for NUL bytes and looking for a reasonable ratio of printable to non-printable characters among the first 4000 bytes.