fsmonitor--daemon: on macOS support symlink

Resolves a problem where symbolic links were not showing up in diff when created or modified. kFSEventStreamEventFlagItemIsSymlink is also treated as a file update. This is because kFSEventStreamEventFlagItemIsFile is not included in FSEvents when creating or deleting symbolic links. For example: $ ln -snf t test fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink| $ ln -snf ci test fsevent: '/path/to/dir/test', flags=0x40200 ItemIsSymlink|ItemRemoved| fsevent: '/path/to/dir/test', flags=0x40100 ItemCreated|ItemIsSymlink| Signed-off-by: srz_zumix <zumix.cpp@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>

srz_zumix committed Nov 8, 2022 at 05:25 UTC ee0e7fc927c309e3ed1d46f7ba970b79d3a38514
1 file changed +1 -1
compat/fsmonitor/fsm-listen-darwin.c
+1 -1
@@ -336,7 +336,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
336 * know how much to invalidate/refresh.
337 */
338
339 - if (event_flags[k] & kFSEventStreamEventFlagItemIsFile) {
339 + if (event_flags[k] & (kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemIsSymlink)) {
340 const char *rel = path_k +
341 state->path_worktree_watch.len + 1;
342