]> git.ipfire.org Git - thirdparty/git.git/commit
fsmonitor: refactor bit invalidation in refresh callback
authorJeff Hostetler <jeffhostetler@github.com>
Mon, 26 Feb 2024 21:39:24 +0000 (21:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Mar 2024 17:10:06 +0000 (09:10 -0800)
commitb0dba507fe3bb12836100f44e2fcfdf69091fd4d
tree55401b6ceeb84c7cac231d7632d77700253556f0
parent84d441f2f09d2974aac75ba93ff3a562d7d31469
fsmonitor: refactor bit invalidation in refresh callback

Refactor code in the fsmonitor_refresh_callback() call chain dealing
with invalidating the CE_FSMONITOR_VALID bit and add a trace message.

During the refresh, we clear the CE_FSMONITOR_VALID bit in response to
data from the FSMonitor daemon (so that a later phase will lstat() and
verify the true state of the file).

Create a new function to clear the bit and add some unique tracing for
it to help debug edge cases.

This is similar to the existing `mark_fsmonitor_invalid()` function,
but it also does untracked-cache invalidation and we've already
handled that in the refresh-callback handlers, so but we don't need
to repeat that.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsmonitor.c