Skip to content

Commit ee0e7fc

Browse files
srz-zumixttaylorr
authored andcommitted
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 <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 3b08839 commit ee0e7fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/fsmonitor/fsm-listen-darwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static void fsevent_callback(ConstFSEventStreamRef streamRef,
336336
* know how much to invalidate/refresh.
337337
*/
338338

339-
if (event_flags[k] & kFSEventStreamEventFlagItemIsFile) {
339+
if (event_flags[k] & (kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemIsSymlink)) {
340340
const char *rel = path_k +
341341
state->path_worktree_watch.len + 1;
342342

0 commit comments

Comments
 (0)