cache-tree: protect against "git prune".
[git.git] / cache-tree.c
index f6d1dd1..b34b0bc 100644 (file)
@@ -177,7 +177,7 @@ static int update_one(struct cache_tree *it,
        char *buffer;
        int i;
 
-       if (0 <= it->entry_count)
+       if (0 <= it->entry_count && has_sha1_file(it->sha1))
                return it->entry_count;
 
        /*