I think Philipp is right.  We have a problem here.  This method is called from isModified() when a content compare is needed because the file entry is stat dirty.  But its recursing back into isModified() via getEntryObjectId().

A quick scan of the code suggests we may infinite loop here until we blow the stack due to too many levels of recursion.  Even if we address the issue of avoiding the infinite recursion, once we are here we kind of know we need to scan the working tree file and should avoid the DirCacheEntry.