Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Halstrick2011-03-22 10:19:18 +0000
committerChristian Halstrick2011-04-02 00:14:01 +0000
commitffbaf694e28fcc62c50326cd555d8f2646d31a0d (patch)
tree1b3211a45119581e2d5647512a19c98064e90b2c /org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
parentc261b28f677fdc755b86d16abebd2c30093514b4 (diff)
downloadjgit-ffbaf694e28fcc62c50326cd555d8f2646d31a0d.tar.gz
jgit-ffbaf694e28fcc62c50326cd555d8f2646d31a0d.tar.xz
jgit-ffbaf694e28fcc62c50326cd555d8f2646d31a0d.zip
Enhance RefDatabase with a refresh() method
There should be a way to explictly refresh the refs cached in the RefDirectory. Since commit c261b28 (use of FileSnapshot) this is not needed anymore for storage in the filesystem. But for DHT based storage an explicit refresh may be needed. Change-Id: I7d30c3496c05e1fb6e9519f3af9f23c6adb93bf9 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
index b2ccf2944a..33c3623058 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
@@ -209,4 +209,15 @@ public abstract class RefDatabase {
* the reference space or object space cannot be accessed.
*/
public abstract Ref peel(Ref ref) throws IOException;
+
+ /**
+ * Triggers a refresh of all internal data structures.
+ * <p>
+ * In case the RefDatabase implementation has internal caches this method
+ * will trigger that all these caches are cleared.
+ * <p>
+ * Implementors should overwrite this method if they use any kind of caches.
+ */
+ public void refresh() {
+ }
}

Back to the top