From f500943ea01eb222dda353df45a55ae544319e4e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 18 Jun 2021 14:45:20 +0200 Subject: [PATCH] gvfs: disable the built-in FSMonitor When using a virtual file system layer, the FSMonitor does not make sense. Signed-off-by: Johannes Schindelin --- fsmonitor-ipc.c | 3 +++ t/t1093-virtualfilesystem.sh | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/fsmonitor-ipc.c b/fsmonitor-ipc.c index 417069725209b1..6cbfa1b282fbfc 100644 --- a/fsmonitor-ipc.c +++ b/fsmonitor-ipc.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "config.h" #include "fsmonitor.h" #include "simple-ipc.h" #include "fsmonitor-ipc.h" @@ -10,6 +11,8 @@ int fsmonitor_ipc__is_supported(void) { + if (git_config_get_virtualfilesystem()) + return 0; return 1; } diff --git a/t/t1093-virtualfilesystem.sh b/t/t1093-virtualfilesystem.sh index 8ba9a2a75e093a..e67ea97112f561 100755 --- a/t/t1093-virtualfilesystem.sh +++ b/t/t1093-virtualfilesystem.sh @@ -368,4 +368,14 @@ test_expect_success 'folder with same prefix as file' ' test_cmp expected actual ' +test_expect_success 'virtualfilsystem hook disables built-in FSMonitor ' ' + clean_repo && + test_config core.usebuiltinfsmonitor true && + write_script .git/hooks/virtualfilesystem <<-\EOF && + printf "dir1/\0" + EOF + git status && + test_must_fail git fsmonitor--daemon status +' + test_done