Skip to content

Commit 54dc783

Browse files
committed
Merge branch 'bd/maint-unpack-trees-parawalk-fix' into maint
* bd/maint-unpack-trees-parawalk-fix: unpack-trees: Make index lookahead less pessimal
2 parents 89fe121 + e53e6b4 commit 54dc783

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

unpack-trees.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,17 @@ static int find_cache_pos(struct traverse_info *info,
520520
const char *ce_name, *ce_slash;
521521
int cmp, ce_len;
522522

523-
if (!ce_in_traverse_path(ce, info))
523+
if (ce->ce_flags & CE_UNPACKED) {
524+
/*
525+
* cache_bottom entry is already unpacked, so
526+
* we can never match it; don't check it
527+
* again.
528+
*/
529+
if (pos == o->cache_bottom)
530+
++o->cache_bottom;
524531
continue;
525-
if (ce->ce_flags & CE_UNPACKED)
532+
}
533+
if (!ce_in_traverse_path(ce, info))
526534
continue;
527535
ce_name = ce->name + pfxlen;
528536
ce_slash = strchr(ce_name, '/');

0 commit comments

Comments
 (0)