- /* We do not read the cache ourselves here, because the
+ * We do not read the cache ourselves here, because the
* benchmark with my previous version that always reads cache
* shows that it makes things worse for diff-tree comparing
* two linux-2.6 kernel trees in an already checked out work
+ * If ce is marked as "assume unchanged", there is no
+ * guarantee that work tree matches what we are looking for.
+ if (ce->ce_flags & CE_VALID)
* If ce matches the file in the work tree, we can reuse it.