summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index f5f668f532..9298fe1d9b 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -417,6 +417,9 @@ static int check_updates(struct unpack_trees_options *o,
progress = get_progress(o, index);
+ /* Start with clean cache to avoid using any possibly outdated info. */
+ invalidate_lstat_cache();
+
git_attr_set_direction(GIT_ATTR_CHECKOUT);
if (should_update_submodules())
@@ -1609,8 +1612,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
o->merge_size = len;
mark_all_ce_unused(o->src_index);
- if (o->src_index->fsmonitor_last_update)
- o->result.fsmonitor_last_update = o->src_index->fsmonitor_last_update;
+ o->result.fsmonitor_last_update =
+ xstrdup_or_null(o->src_index->fsmonitor_last_update);
/*
* Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries