Merge branch 'jc/index-extended-flags'

* jc/index-extended-flags:
  index: future proof for "extended" index entries
This commit is contained in:
Junio C Hamano 2008-08-20 23:41:47 -07:00
commit 0a8eb7bae5
2 changed files with 5 additions and 0 deletions

View File

@ -126,6 +126,7 @@ struct cache_entry {
#define CE_NAMEMASK (0x0fff)
#define CE_STAGEMASK (0x3000)
#define CE_EXTENDED (0x4000)
#define CE_VALID (0x8000)
#define CE_STAGESHIFT 12

View File

@ -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;