Patch Set 1:

Porting this to DirCache later will be a problem.
Change operations use Repository.lockDirCache(). This creates a new DirCache instance. 
Thus e.g. a commit inside EGit using the Git porcelain API would cause an "external change".