summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-02-02 21:37:10 (GMT)
committerJohannes Schindelin <johannes.schindelin@gmx.de>2021-02-12 14:47:02 (GMT)
commit22539ec3b5e678c054ab361a37a7cdcc64ca1228 (patch)
tree09a976a2263611475f713e394b22d29c4d9cbec8 /unpack-trees.c
parent0d58fef58a6f382ba1d35f47a01cb55d8976335f (diff)
downloadgit-22539ec3b5e678c054ab361a37a7cdcc64ca1228.zip
git-22539ec3b5e678c054ab361a37a7cdcc64ca1228.tar.gz
git-22539ec3b5e678c054ab361a37a7cdcc64ca1228.tar.bz2
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>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 88a0b5d..5914e7b 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -349,6 +349,9 @@ static int check_updates(struct unpack_trees_options *o)
progress = get_progress(o);
+ /* Start with clean cache to avoid using any possibly outdated info. */
+ invalidate_lstat_cache();
+
if (o->update)
git_attr_set_direction(GIT_ATTR_CHECKOUT, index);