summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2022-05-26 21:47:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-05-26 22:59:26 (GMT)
commit9968ed73ff8bf00d06862e6653451faeb008afef (patch)
treecefe5a8c789806be0c925e3d634b197d079bb5cf /unpack-trees.c
parentddc5dacfb368d4903f5dd475897e5e11772f9970 (diff)
downloadgit-9968ed73ff8bf00d06862e6653451faeb008afef.zip
git-9968ed73ff8bf00d06862e6653451faeb008afef.tar.gz
git-9968ed73ff8bf00d06862e6653451faeb008afef.tar.bz2
unpack-trees: initialize fsmonitor_has_run_once in o->result
Initialize `o->result.fsmonitor_has_run_once` based upon value in `o->src_index->fsmonitor_has_run_once` to prevent a second fsmonitor query during the tree traversal and possibly getting a skewed view of the working directory. The checkout code has already talked to the fsmonitor and the traversal is updating the index as it traverses, so there is no need to query the fsmonitor. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 360844b..888cff8 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1772,6 +1772,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
o->result.fsmonitor_last_update =
xstrdup_or_null(o->src_index->fsmonitor_last_update);
+ o->result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once;
/*
* Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries