summaryrefslogtreecommitdiffstats
path: root/fsmonitor.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhostetler@github.com>2024-02-26 22:39:23 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-06 18:10:06 +0100
commit84d441f2f09d2974aac75ba93ff3a562d7d31469 (patch)
tree43ca232881a52b722e244fb01acf1e1394cd4248 /fsmonitor.c
parentfsmonitor: return invalidated cache-entry count on non-directory event (diff)
downloadgit-84d441f2f09d2974aac75ba93ff3a562d7d31469.tar.xz
git-84d441f2f09d2974aac75ba93ff3a562d7d31469.zip
fsmonitor: trace the new invalidated cache-entry count
Consolidate the directory/non-directory calls to the refresh handler code. Log the resulting count of invalidated cache-entries. The nr_in_cone value will be used in a later commit to decide if we also need to try to do case-insensitive lookups. Signed-off-by: Jeff Hostetler <jeffhostetler@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r--fsmonitor.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fsmonitor.c b/fsmonitor.c
index c16ed5d875..739ddbf7ac 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -308,16 +308,21 @@ static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
{
int len = strlen(name);
int pos = index_name_pos(istate, name, len);
+ size_t nr_in_cone;
trace_printf_key(&trace_fsmonitor,
"fsmonitor_refresh_callback '%s' (pos %d)",
name, pos);
- if (name[len - 1] == '/') {
- handle_path_with_trailing_slash(istate, name, pos);
- } else {
- handle_path_without_trailing_slash(istate, name, pos);
- }
+ if (name[len - 1] == '/')
+ nr_in_cone = handle_path_with_trailing_slash(istate, name, pos);
+ else
+ nr_in_cone = handle_path_without_trailing_slash(istate, name, pos);
+
+ if (nr_in_cone)
+ trace_printf_key(&trace_fsmonitor,
+ "fsmonitor_refresh_callback CNT: %d",
+ (int)nr_in_cone);
}
/*