summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-22 09:45:22 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-22 09:45:22 -0700
commit3919d40cfb23b2c763a4979c4a1512424adc8442 (patch)
treecf9bdefe6163534401a6e01f1b83874d80bc7d75
parent8c7da8690d2dfc84c9f827796bc730d900b5fba7 (diff)
parente53e6b4433f264250c2e586167caf61721b0185c (diff)
downloadgit-3919d40cfb23b2c763a4979c4a1512424adc8442.tar.gz
Merge branch 'bd/maint-unpack-trees-parawalk-fix'
* bd/maint-unpack-trees-parawalk-fix: unpack-trees: Make index lookahead less pessimal
-rw-r--r--unpack-trees.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 85045fd03f..8cf0da317d 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -522,9 +522,17 @@ static int find_cache_pos(struct traverse_info *info,
const char *ce_name, *ce_slash;
int cmp, ce_len;
- if (!ce_in_traverse_path(ce, info))
+ if (ce->ce_flags & CE_UNPACKED) {
+ /*
+ * cache_bottom entry is already unpacked, so
+ * we can never match it; don't check it
+ * again.
+ */
+ if (pos == o->cache_bottom)
+ ++o->cache_bottom;
continue;
- if (ce->ce_flags & CE_UNPACKED)
+ }
+ if (!ce_in_traverse_path(ce, info))
continue;
ce_name = ce->name + pfxlen;
ce_slash = strchr(ce_name, '/');