path: root/read-cache.c
diff options
authorJunio C Hamano <>2008-08-17 06:02:08 (GMT)
committerJunio C Hamano <>2008-08-17 07:22:45 (GMT)
commit16ce2e4c8f9664f8ec5ae2bffed34d093d83a4d3 (patch)
tree3365a094d0ccd07b4bf1b2ea072ea11e63d9ff01 /read-cache.c
parent053fd0c1c3da20474c4ff175c56ea4c1d6eeda11 (diff)
index: future proof for "extended" index entries
We do not have any more bits in the on-disk index flags word, but we would need to have more in the future. Use the last remaining bits as a signal to tell us that the index entry we are looking at is an extended one. Since we do not understand the extended format yet, we will just error out when we see it. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'read-cache.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 2c03ec3..f0ba224 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1118,6 +1118,10 @@ static void convert_from_disk(struct ondisk_cache_entry *ondisk, struct cache_en
ce->ce_size = ntohl(ondisk->size);
/* On-disk flags are just 16 bits */
ce->ce_flags = ntohs(ondisk->flags);
+ /* For future extension: we do not understand this entry yet */
+ if (ce->ce_flags & CE_EXTENDED)
+ die("Unknown index entry format");
hashcpy(ce->sha1, ondisk->sha1);
len = ce->ce_flags & CE_NAMEMASK;