]> source.dussan.org Git - jgit.git/commit
Fire IndexChangedEvent on DirCache.commit() 19/4219/9
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 29 Sep 2011 22:00:22 +0000 (00:00 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 29 Sep 2011 22:00:22 +0000 (00:00 +0200)
commit0db047654263144234a66fe3806811801a61da4f
treebf8359e95d7a838a01ac41066399048ce711208e
parente630f913051ae80c19ed3caca9d206e5a2b96d21
Fire IndexChangedEvent on DirCache.commit()

Since we replaced GitIndex by DirCache JGit didn't fire
IndexChangedEvents anymore. For EGit this still worked with a high
latency since its RepositoryChangeScanner which is scheduled to
run each 10 seconds fires the event in case the index changes.
This scanner is meant to detect index changes induced by a different
process e.g. by calling "git add" from native git.

When the index is changed from within the same process we should fire
the event synchronously. Compare the index checksum on write to index
checksum when index was read earlier to determine if index really
changed. Use IndexChangedListener interface to keep DirCache decoupled
from Repository.

Change-Id: Id4311f7a7859ffe8738863b3d86c83c8b5f513af
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java