Always doing a content check is horribly expensive.  Normally a Git application will check timestamps between the indexEntry and resourceEntry, and then fall back into content check only if a race condition was detected.  The logic is roughly:

  IF indexEntry.time != resourceEntry.time:
    assume dirty / modified

  ELSE:
    IF indexEntry.time != indexFile.time:
        assume clean

    ELSE:
       IF indexContent == resourceContent:
         set indexFile.time = resourceEntry.time
         save indexFile

       ELSE:
         set indexFile.time != resourceEntry.time
         save indexFile

This is the "racily clean" or "racy git" problem in Git.  For a bit more details, try looking at DirCacheEntry at the mightBeRacilyClean and smudgeRacilyClean methods.  The decorator code is basically doing the work of "git status" in command line tools, it should be taking advantage of the same strategy about checking file modification times, falling back into content checks when there is a race condition, and correcting the cached index timestamp after a content check so we don't have to do it again during a future request.

Basically that's what the TODO you deleted was trying to talk about.