]> git.ipfire.org Git - thirdparty/git.git/commitdiff
unpack-trees: initialize fsmonitor_has_run_once in o->result
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 26 May 2022 21:47:05 +0000 (21:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:59:26 +0000 (15:59 -0700)
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>
unpack-trees.c

index 360844bda3ab976c73e9443b318b58dfc400f475..888cff81f9c51126c0b1858a0db874574d92cd73 100644 (file)
@@ -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