aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2010-07-08 01:51:17 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2010-07-09 14:12:06 +0200
commitb8f2bb7d2a6b713de5b8ed14f0f326134d3433eb (patch)
tree2824c0abea9041ce3a091c903532c5b9629062db /org.eclipse.jgit
parent354b90131aa60f03f087e5b30f52d80044ca9b53 (diff)
downloadjgit-b8f2bb7d2a6b713de5b8ed14f0f326134d3433eb.tar.gz
jgit-b8f2bb7d2a6b713de5b8ed14f0f326134d3433eb.zip
Add support for updateNeeded flag in DirCacheEntry
Change-Id: If06ff41d9ccd422afbc79ecbc3cfdf8bb2508dcd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
index 3a6941a6df..7cb1472e46 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2008-2009, Google Inc.
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
+ * Copyright (C) 2010, Matthias Sohn <matthias.sohn@sap.com>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -114,6 +115,8 @@ public class DirCacheEntry {
private static final int ASSUME_VALID = 0x80;
+ private static final int UPDATE_NEEDED = 0x40;
+
/** (Possibly shared) header information storage. */
private final byte[] info;
@@ -356,6 +359,25 @@ public class DirCacheEntry {
}
/**
+ * @return true if this entry should be checked for changes
+ */
+ public boolean isUpdateNeeded() {
+ return (info[infoOffset + P_FLAGS] & UPDATE_NEEDED) != 0;
+ }
+
+ /**
+ * Set whether this entry must be checked for changes
+ *
+ * @param updateNeeded
+ */
+ public void setUpdateNeeded(boolean updateNeeded) {
+ if (updateNeeded)
+ info[infoOffset + P_FLAGS] |= UPDATE_NEEDED;
+ else
+ info[infoOffset + P_FLAGS] &= ~UPDATE_NEEDED;
+ }
+
+ /**
* Get the stage of this entry.
* <p>
* Entries have one of 4 possible stages: 0-3.