Check jgit RawText#isBinary before MimeTypes

JGit's isBinary function implements a simple heuristic: it considers
a file binary if and only if one of the first 8000 bytes is NUL.
This is the same heuristic used to decide whether to show a diff as
text.

Keep the MimeTypes based check to allow users to continue to exclude
text-based checks for some file types. A followup change will allow
whitelisting some files or commits using notes in the
refs/notes/uploadvalidator ref, allowing the MimeTypes check to be
dropped.

Change-Id: I2726af4bf3235ee7a03cc06d88c9877f7081ae4b
4 files changed
tree: d573449939002e0c47855509f210f9f62c0e7839
  1. .gitignore
  2. .settings/
  3. BUILD
  4. LICENSE
  5. external_plugin_deps.bzl
  6. src/