Skip to content

Commit 8868048

Browse files
dschoderrickstolee
authored andcommitted
Merge pull request git-for-windows#379 from dscho/disable-fsmonitor-with-gvfs
vfs: disable the built-in FSMonitor
2 parents 0978f54 + 8ea0db8 commit 8868048

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

fsmonitor-ipc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "cache.h"
2+
#include "config.h"
23
#include "fsmonitor.h"
34
#include "simple-ipc.h"
45
#include "fsmonitor-ipc.h"
@@ -10,6 +11,8 @@
1011

1112
int fsmonitor_ipc__is_supported(void)
1213
{
14+
if (git_config_get_virtualfilesystem())
15+
return 0;
1316
return 1;
1417
}
1518

fsmonitor-settings.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ static void lookup_fsmonitor_settings(struct repository *r)
127127

128128
enum fsmonitor_mode fsm_settings__get_mode(struct repository *r)
129129
{
130+
if (git_config_get_virtualfilesystem())
131+
return FSMONITOR_MODE_INCOMPATIBLE;
132+
130133
if (!r->settings.fsmonitor)
131134
lookup_fsmonitor_settings(r);
132135

t/t1093-virtualfilesystem.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,15 @@ test_expect_success 'folder with same prefix as file' '
368368
test_cmp expected actual
369369
'
370370

371+
test_expect_success 'virtualfilsystem hook disables built-in FSMonitor ' '
372+
clean_repo &&
373+
test_config core.usebuiltinfsmonitor true &&
374+
write_script .git/hooks/virtualfilesystem <<-\EOF &&
375+
printf "dir1/\0"
376+
EOF
377+
git config core.virtualfilesystem .git/hooks/virtualfilesystem &&
378+
git status &&
379+
test_must_fail git fsmonitor--daemon status
380+
'
381+
371382
test_done

0 commit comments

Comments
 (0)