aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-28 16:18:02 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-28 16:18:02 -0700
commit54dc78376652d5c3aa481c730bfb1336b0883136 (patch)
treeb920ab3e00c84c0af7bd4eed435939d785c3ff8c
parent89fe121d5fd808391ee38b7f39b88cb3f912776f (diff)
parente53e6b4433f264250c2e586167caf61721b0185c (diff)
downloadgit-54dc78376652d5c3aa481c730bfb1336b0883136.tar.gz
git-54dc78376652d5c3aa481c730bfb1336b0883136.tar.xz
Merge branch 'bd/maint-unpack-trees-parawalk-fix' into maint
* 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 490cd5f6f..e8f03f515 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -520,9 +520,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, '/');