Skip to content

Commit

Permalink
gvfs: disable the built-in FSMonitor
Browse files Browse the repository at this point in the history
When using a virtual file system layer, the FSMonitor does not make
sense.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and derrickstolee committed Aug 17, 2021
1 parent 8f3ebdc commit 8ea0db8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fsmonitor-ipc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "cache.h"
#include "config.h"
#include "fsmonitor.h"
#include "simple-ipc.h"
#include "fsmonitor-ipc.h"
Expand All @@ -10,6 +11,8 @@

int fsmonitor_ipc__is_supported(void)
{
if (git_config_get_virtualfilesystem())
return 0;
return 1;
}

Expand Down
3 changes: 3 additions & 0 deletions fsmonitor-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ static void lookup_fsmonitor_settings(struct repository *r)

enum fsmonitor_mode fsm_settings__get_mode(struct repository *r)
{
if (git_config_get_virtualfilesystem())
return FSMONITOR_MODE_INCOMPATIBLE;

if (!r->settings.fsmonitor)
lookup_fsmonitor_settings(r);

Expand Down
11 changes: 11 additions & 0 deletions t/t1093-virtualfilesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,15 @@ 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 config core.virtualfilesystem .git/hooks/virtualfilesystem &&
git status &&
test_must_fail git fsmonitor--daemon status
'

test_done

0 comments on commit 8ea0db8

Please sign in to comment.