libgit2/libgit2 — pull request #1477 by ethomson (2013-04-17 15:57:17+00:00)
Title: checkout: use cache when possible to determine if workdir item is dirty

If the on-disk file has been staged (it's stat data matches the stat data
in the cache) then we need not hash the file to determine whether it
differs from the checkout target; instead we can simply use the oid in
the index.

This prevents recomputing a file's hash unnecessarily, prevents loading
the file (when filtering) and prevents edge cases where filters suggest
that a file is dirty immediately after git writes the file.