Patch Set 3:

I'm a little loathe to add a new field to DirCacheEntry given the size of it and everything.  But we might have no choice here.

FWIW, if we do this readonly flag idea Jens proposes, lets do it as a bit field in an int.  There are other flags C Git winds up using within their equivalent of the DirCacheEntry that are strictly in-memory and we might find we need to do something similar.  (But lets hide it behind an isReadOnly() or assertNotReadOnly() method so we can easily test it inside of set methods.)