diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2011-09-30 00:00:22 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2011-09-30 00:00:22 +0200 |
commit | 0db047654263144234a66fe3806811801a61da4f (patch) | |
tree | bf8359e95d7a838a01ac41066399048ce711208e /org.eclipse.jgit.storage.dht | |
parent | e630f913051ae80c19ed3caca9d206e5a2b96d21 (diff) | |
download | jgit-0db047654263144234a66fe3806811801a61da4f.tar.gz jgit-0db047654263144234a66fe3806811801a61da4f.zip |
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>
Diffstat (limited to 'org.eclipse.jgit.storage.dht')
-rw-r--r-- | org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java b/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java index 9f60ef5758..faff469e90 100644 --- a/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java +++ b/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/DhtRepository.java @@ -154,6 +154,11 @@ public class DhtRepository extends Repository { } @Override + public void notifyIndexChanged() { + // we do not support non-bare repositories yet + } + + @Override public String toString() { return "DhtRepostitory[" + key + " / " + name + "]"; } |