summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrz_zumix <zumix.cpp@gmail.com>2022-11-08 05:25:19 +0000
committerTaylor Blau <me@ttaylorr.com>2022-11-08 16:36:09 -0500
commitee0e7fc927c309e3ed1d46f7ba970b79d3a38514 (patch)
tree05cf1c7105be66e81d40aaff0efb2abc0295ca7f
parent3b08839926fcc7cc48cf4c759737c1a71af430c1 (diff)
downloadgit-ee0e7fc927c309e3ed1d46f7ba970b79d3a38514.tar.gz
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>
-rw-r--r--compat/fsmonitor/fsm-listen-darwin.c2
1 files changed, 1 insertions, 1 deletions
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;