Merge branch 'rs/t4062-obsd'
[gitweb.git] / builtin / ls-files.c
index dc4a6aa3d951b46220dcb084d3f86ca7a4cc1a29..c6126eae550beb75e7c90094be337efbb48cd3bc 100644 (file)
@@ -362,7 +362,7 @@ static void prune_index(struct index_state *istate,
        int pos;
        unsigned int first, last;
 
-       if (!prefix)
+       if (!prefix || !istate->cache_nr)
                return;
        pos = index_name_pos(istate, prefix, prefixlen);
        if (pos < 0)