Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorsrz_zumix <zumix.cpp@gmail.com>2022-11-08 08:25:19 +0300
committerTaylor Blau <me@ttaylorr.com>2022-11-09 00:36:09 +0300
commitee0e7fc927c309e3ed1d46f7ba970b79d3a38514 (patch)
tree05cf1c7105be66e81d40aaff0efb2abc0295ca7f /compat
parent3b08839926fcc7cc48cf4c759737c1a71af430c1 (diff)
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>
Diffstat (limited to 'compat')
-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;