瀏覽代碼

Add isOutdated method to DirCache

isOutdated returns true iff the memory state differs from the index
file.

Change-Id: If35db06743f5f588ab19d360fd2a18a07c918edb
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
tags/v0.11.1
Jens Baumgart 13 年之前
父節點
當前提交
c9e4a78555
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10
    0
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java

+ 10
- 0
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;

Loading…
取消
儲存