Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
index 143447c8d6..c2c57c9840 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java
@@ -312,6 +312,16 @@ public class DirCache {
}
}
+ /**
+ * @return true if the memory state differs from the index file
+ * @throws IOException
+ */
+ public boolean isOutdated() throws IOException {
+ if (liveFile == null || !liveFile.exists())
+ return false;
+ return liveFile.lastModified() != lastModified;
+ }
+
/** Empty this index, removing all entries. */
public void clear() {
lastModified = 0;

Back to the top