summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-06-28 16:18:02 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-06-28 16:18:02 -0700
commit54dc78376652d5c3aa481c730bfb1336b0883136 (patch)
treeb920ab3e00c84c0af7bd4eed435939d785c3ff8c /unpack-trees.c
parentnotes: Initialise variable to appease gcc (diff)
parentunpack-trees: Make index lookahead less pessimal (diff)
downloadtgif-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
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 490cd5f6f4..e8f03f5154 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, '/');