aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unpack-trees.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index f88a69f8e7..87c1ed204c 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -600,6 +600,13 @@ static void mark_ce_used(struct cache_entry *ce, struct unpack_trees_options *o)
{
ce->ce_flags |= CE_UNPACKED;
+ /*
+ * If this is a sparse directory, don't advance cache_bottom.
+ * That will be advanced later using the cache-tree data.
+ */
+ if (S_ISSPARSEDIR(ce->ce_mode))
+ return;
+
if (o->cache_bottom < o->src_index->cache_nr &&
o->src_index->cache[o->cache_bottom] == ce) {
int bottom = o->cache_bottom;