]> source.dussan.org Git - jgit.git/commitdiff
DirCacheEntry: UPDATE_NEEDED should be in-core flag. 65/1465/1
authorMarc Strapetz <marc.strapetz@syntevo.com>
Tue, 31 Aug 2010 09:25:16 +0000 (11:25 +0200)
committerMarc Strapetz <marc.strapetz@syntevo.com>
Tue, 31 Aug 2010 09:25:16 +0000 (11:25 +0200)
In correspondance to CGit, UPDATE_NEEDED flag should not be
written to disk. Furthermore, it currently intersects CGit's
CE_EXTENDED flag.

org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java

index b7fc1c787dd0c329b4370ebad0a2ec3539031ecc..308d4d168ffa72cf8f151bc04c3fb084b94da584 100644 (file)
@@ -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;
        }
 
        /**