unpack_trees(): start with a fresh lstat cache

We really want to avoid relying on stale information. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Matheus Tavares committed Feb 2, 2021 at 22:37 UTC 22539ec3b5e678c054ab361a37a7cdcc64ca1228
1 file changed +3
unpack-trees.c
+3
@@ -349,6 +349,9 @@ static int check_updates(struct unpack_trees_options *o)
349
350 progress = get_progress(o);
351
352 + /* Start with clean cache to avoid using any possibly outdated info. */
353 + invalidate_lstat_cache();
354 +
355 if (o->update)
356 git_attr_set_direction(GIT_ATTR_CHECKOUT, index);
357