aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Strapetz2010-08-31 05:25:16 (EDT)
committerMarc Strapetz2010-08-31 05:25:16 (EDT)
commit2eb5426aa95051e48d8feae3e90f710e6d1996ce (patch)
tree08f9781bbfc6cfeaff9c3ca0b05f797ffa9fe958
parent6517a7c923e012ea4b3d9f2497122d9c64dbdd5e (diff)
downloadjgit-2eb5426aa95051e48d8feae3e90f710e6d1996ce.zip
jgit-2eb5426aa95051e48d8feae3e90f710e6d1996ce.tar.gz
jgit-2eb5426aa95051e48d8feae3e90f710e6d1996ce.tar.bz2
DirCacheEntry: UPDATE_NEEDED should be in-core flag.refs/changes/65/1465/1
In correspondance to CGit, UPDATE_NEEDED flag should not be written to disk. Furthermore, it currently intersects CGit's CE_EXTENDED flag.
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java12
1 files changed, 8 insertions, 4 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 b7fc1c7..308d4d1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
@@ -116,7 +116,8 @@ public class DirCacheEntry {
private static final int ASSUME_VALID = 0x80;
- private static final int UPDATE_NEEDED = 0x40;
+ /** In-core flag signaling that the entry should be considered as modified. */
+ private static final int UPDATE_NEEDED = 0x1;
/** (Possibly shared) header information storage. */
private final byte[] info;
@@ -127,6 +128,9 @@ public class DirCacheEntry {
/** Our encoded path name, from the root of the repository. */
final byte[] path;
+ /** Flags which are never stored to disk. */
+ private byte inCoreFlags;
+
DirCacheEntry(final byte[] sharedInfo, final int infoAt,
final InputStream in, final MessageDigest md) throws IOException {
info = sharedInfo;
@@ -370,7 +374,7 @@ public class DirCacheEntry {
* @return true if this entry should be checked for changes
*/
public boolean isUpdateNeeded() {
- return (info[infoOffset + P_FLAGS] & UPDATE_NEEDED) != 0;
+ return (inCoreFlags & UPDATE_NEEDED) != 0;
}
/**
@@ -380,9 +384,9 @@ public class DirCacheEntry {
*/
public void setUpdateNeeded(boolean updateNeeded) {
if (updateNeeded)
- info[infoOffset + P_FLAGS] |= UPDATE_NEEDED;
+ inCoreFlags |= UPDATE_NEEDED;
else
- info[infoOffset + P_FLAGS] &= ~UPDATE_NEEDED;
+ inCoreFlags &= ~UPDATE_NEEDED;
}
/**