aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-15 21:45:38 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-15 21:45:38 -0700
commitf5cabd13d814bb5c547a13af03bcc42122531141 (patch)
tree6795adc096e36c7a7f8e6a407297727e61d4d083 /cache.h
parent13e897e58072678cdae3ec1db51cc91110dc559d (diff)
downloadgit-f5cabd13d814bb5c547a13af03bcc42122531141.tar.gz
git-f5cabd13d814bb5c547a13af03bcc42122531141.tar.xz
Encode a few extra flags per index entry.
This will allow us to have the same name in different "states" in the index at the same time. Which in turn seems to be a very simple way to merge.
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index 5b3cd95aa..bce48b00d 100644
--- a/cache.h
+++ b/cache.h
@@ -59,10 +59,14 @@ struct cache_entry {
unsigned int ce_gid;
unsigned int ce_size;
unsigned char sha1[20];
- unsigned short ce_namelen;
+ unsigned short ce_flags;
char name[0];
};
+#define CE_NAMEMASK (0x0fff)
+#define CE_STAGE1 (0x1000)
+#define CE_STAGE2 (0x2000)
+
const char *sha1_file_directory;
struct cache_entry **active_cache;
unsigned int active_nr, active_alloc;
@@ -71,7 +75,7 @@ unsigned int active_nr, active_alloc;
#define DEFAULT_DB_ENVIRONMENT ".git/objects"
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
-#define ce_namelen(ce) ntohs((ce)->ce_namelen)
+#define ce_namelen(ce) (CE_NAMEMASK & ntohs((ce)->ce_flags))
#define ce_size(ce) cache_entry_size(ce_namelen(ce))
#define alloc_nr(x) (((x)+16)*3/2)