summaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-23 20:55:16 -0700
committerJunio C Hamano <gitster@pobox.com>2012-07-23 20:55:21 -0700
commit30ea575876f61c38c59cd578afd8e8789857094b (patch)
tree581da17bd126cf8f6dc45325a80551c4818622ab /tree.c
parent6da9ded763b69685149c2f9a752e2005261bf0c3 (diff)
parentb60e188c51242b72061b5f2f0d4df80397f6125a (diff)
downloadgit-30ea575876f61c38c59cd578afd8e8789857094b.tar.gz
Merge branch 'tg/ce-namelen-field'
Split lower bits of ce_flags field and creates a new ce_namelen field in the in-core index structure. * tg/ce-namelen-field: Strip namelen out of ce_flags into a ce_namelen field
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tree.c b/tree.c
index 676e9f710c..62fed632d8 100644
--- a/tree.c
+++ b/tree.c
@@ -22,7 +22,8 @@ static int read_one_entry_opt(const unsigned char *sha1, const char *base, int b
ce = xcalloc(1, size);
ce->ce_mode = create_ce_mode(mode);
- ce->ce_flags = create_ce_flags(baselen + len, stage);
+ ce->ce_flags = create_ce_flags(stage);
+ ce->ce_namelen = baselen + len;
memcpy(ce->name, base, baselen);
memcpy(ce->name + baselen, pathname, len+1);
hashcpy(ce->sha1, sha1);
@@ -133,8 +134,8 @@ static int cmp_cache_name_compare(const void *a_, const void *b_)
ce1 = *((const struct cache_entry **)a_);
ce2 = *((const struct cache_entry **)b_);
- return cache_name_compare(ce1->name, ce1->ce_flags,
- ce2->name, ce2->ce_flags);
+ return cache_name_stage_compare(ce1->name, ce1->ce_namelen, ce_stage(ce1),
+ ce2->name, ce2->ce_namelen, ce_stage(ce2));
}
int read_tree(struct tree *tree, int stage, struct pathspec *match)