X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=unpack-trees.c;h=8cf0da317d8afe4bfe3cae7051e3a385d44cf7ef;hb=0c357544b0d4415c464fb8b35593b21db1d1f7f7;hp=85045fd03fd7ab2a2ad8daf5ec584e010372673b;hpb=1a5296cb92691c5656bbc6aacaf49ca31b1ee8c0;p=thirdparty%2Fgit.git 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, '/');