Skip to content

Commit bc40a56

Browse files
committed
fixup! fsmonitor: introduce core.useBuiltinFSMonitor to call the daemon via IPC
In FSMonitor v1, we made sure to only use a valid `since_token` when querying the FSMonitor. This condition was accidentally lost in v2, and caused segmentation faults uncovered by Scalar's Functional Tests. I had tried to fix this in https://github.com/git-for-windows/pull/3241, but the fix was incomplete, and I had to follow up with https://github.com/git-for-windows/pull/3258. However, it turns out that both of them were actually only work-arounds; I should have dug deeper to figure out _why_ the `since_token` was no longer guaranteed not to be `NULL`, and I finally did. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4c20499 commit bc40a56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fsmonitor.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ void refresh_fsmonitor(struct index_state *istate)
290290
trace_printf_key(&trace_fsmonitor, "refresh fsmonitor");
291291

292292
if (r->settings.use_builtin_fsmonitor > 0) {
293-
query_success = !fsmonitor_ipc__send_query(
294-
istate->fsmonitor_last_update, &query_result);
293+
query_success = istate->fsmonitor_last_update &&
294+
!fsmonitor_ipc__send_query(istate->fsmonitor_last_update,
295+
&query_result);
295296
if (query_success) {
296297
/*
297298
* The response contains a series of nul terminated

0 commit comments

Comments
 (0)