From: srz_zumix Date: Tue, 8 Nov 2022 05:25:19 +0000 (+0000) Subject: fsmonitor--daemon: on macOS support symlink X-Git-Tag: v2.39.0-rc0~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee0e7fc927c309e3ed1d46f7ba970b79d3a38514;p=thirdparty%2Fgit.git 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 Signed-off-by: Taylor Blau --- diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c index daeee4e465..cc9af1e3cb 100644 --- a/compat/fsmonitor/fsm-listen-darwin.c +++ b/compat/fsmonitor/fsm-listen-darwin.c @@ -336,7 +336,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef, * know how much to invalidate/refresh. */ - if (event_flags[k] & kFSEventStreamEventFlagItemIsFile) { + if (event_flags[k] & (kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemIsSymlink)) { const char *rel = path_k + state->path_worktree_watch.len + 1;