Skip to content

Commit 72ffbb7

Browse files
jeffhostetlerdscho
authored andcommitted
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 <[email protected]>
1 parent 6803d5c commit 72ffbb7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

unpack-trees.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
17401740

17411741
o->result.fsmonitor_last_update =
17421742
xstrdup_or_null(o->src_index->fsmonitor_last_update);
1743+
o->result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once;
17431744

17441745
/*
17451746
* Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries

0 commit comments

Comments
 (0)