diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-23 20:55:16 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-23 20:55:21 -0700 |
commit | 30ea575876f61c38c59cd578afd8e8789857094b (patch) | |
tree | 581da17bd126cf8f6dc45325a80551c4818622ab /builtin | |
parent | Merge branch 'nk/maint-gitweb-log-by-lines' (diff) | |
parent | Strip namelen out of ce_flags into a ce_namelen field (diff) | |
download | tgif-30ea575876f61c38c59cd578afd8e8789857094b.tar.xz |
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 'builtin')
-rw-r--r-- | builtin/apply.c | 6 | ||||
-rw-r--r-- | builtin/blame.c | 3 | ||||
-rw-r--r-- | builtin/checkout.c | 3 | ||||
-rw-r--r-- | builtin/update-index.c | 9 |
4 files changed, 14 insertions, 7 deletions
diff --git a/builtin/apply.c b/builtin/apply.c index 069cf341b6..d453c83378 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -3769,7 +3769,8 @@ static void add_index_file(const char *path, unsigned mode, void *buf, unsigned ce = xcalloc(1, ce_size); memcpy(ce->name, path, namelen); ce->ce_mode = create_ce_mode(mode); - ce->ce_flags = namelen; + ce->ce_flags = create_ce_flags(0); + ce->ce_namelen = namelen; if (S_ISGITLINK(mode)) { const char *s = buf; @@ -3890,7 +3891,8 @@ static void add_conflicted_stages_file(struct patch *patch) ce = xcalloc(1, ce_size); memcpy(ce->name, patch->new_name, namelen); ce->ce_mode = create_ce_mode(mode); - ce->ce_flags = create_ce_flags(namelen, stage); + ce->ce_flags = create_ce_flags(stage); + ce->ce_namelen = namelen; hashcpy(ce->sha1, patch->threeway_stage[stage - 1]); if (add_cache_entry(ce, ADD_CACHE_OK_TO_ADD) < 0) die(_("unable to add cache entry for %s"), patch->new_name); diff --git a/builtin/blame.c b/builtin/blame.c index 960c58d855..0d50273ce9 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2171,7 +2171,8 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, ce = xcalloc(1, size); hashcpy(ce->sha1, origin->blob_sha1); memcpy(ce->name, path, len); - ce->ce_flags = create_ce_flags(len, 0); + ce->ce_flags = create_ce_flags(0); + ce->ce_namelen = len; ce->ce_mode = create_ce_mode(mode); add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE); diff --git a/builtin/checkout.c b/builtin/checkout.c index 3980d5d06e..6acca75f47 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -73,7 +73,8 @@ static int update_some(const unsigned char *sha1, const char *base, int baselen, hashcpy(ce->sha1, sha1); memcpy(ce->name, base, baselen); memcpy(ce->name + baselen, pathname, len - baselen); - ce->ce_flags = create_ce_flags(len, 0) | CE_UPDATE; + ce->ce_flags = create_ce_flags(0) | CE_UPDATE; + ce->ce_namelen = len; ce->ce_mode = create_ce_mode(mode); add_cache_entry(ce, ADD_CACHE_OK_TO_ADD | ADD_CACHE_OK_TO_REPLACE); return 0; diff --git a/builtin/update-index.c b/builtin/update-index.c index 5a4e9ea55a..4ce341ceeb 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -95,7 +95,8 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru size = cache_entry_size(len); ce = xcalloc(1, size); memcpy(ce->name, path, len); - ce->ce_flags = len; + ce->ce_flags = create_ce_flags(0); + ce->ce_namelen = len; fill_stat_cache_info(ce, st); ce->ce_mode = ce_mode_from_stat(old, st->st_mode); @@ -229,7 +230,8 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1, hashcpy(ce->sha1, sha1); memcpy(ce->name, path, len); - ce->ce_flags = create_ce_flags(len, stage); + ce->ce_flags = create_ce_flags(stage); + ce->ce_namelen = len; ce->ce_mode = create_ce_mode(mode); if (assume_unchanged) ce->ce_flags |= CE_VALID; @@ -427,7 +429,8 @@ static struct cache_entry *read_one_ent(const char *which, hashcpy(ce->sha1, sha1); memcpy(ce->name, path, namelen); - ce->ce_flags = create_ce_flags(namelen, stage); + ce->ce_flags = create_ce_flags(stage); + ce->ce_namelen = namelen; ce->ce_mode = create_ce_mode(mode); return ce; } |