safe.directory: preliminary clean-up
[git/gitster.git] / compat / fsmonitor / fsm-settings-win32.c
blob0f2aa321f6e15f729aef67d4012fea6513cacfa4
1 #include "git-compat-util.h"
2 #include "config.h"
3 #include "repository.h"
4 #include "fsmonitor-ll.h"
5 #include "fsmonitor-settings.h"
6 #include "fsmonitor-path-utils.h"
8 /*
9 * VFS for Git is incompatible with FSMonitor.
11 * Granted, core Git does not know anything about VFS for Git and we
12 * shouldn't make assumptions about a downstream feature, but users
13 * can install both versions. And this can lead to incorrect results
14 * from core Git commands. So, without bringing in any of the VFS for
15 * Git code, do a simple config test for a published config setting.
16 * (We do not look at the various *_TEST_* environment variables.)
18 static enum fsmonitor_reason check_vfs4git(struct repository *r)
20 const char *const_str;
22 if (!repo_config_get_value(r, "core.virtualfilesystem", &const_str))
23 return FSMONITOR_REASON_VFS4GIT;
25 return FSMONITOR_REASON_OK;
28 enum fsmonitor_reason fsm_os__incompatible(struct repository *r, int ipc UNUSED)
30 enum fsmonitor_reason reason;
32 reason = check_vfs4git(r);
33 if (reason != FSMONITOR_REASON_OK)
34 return reason;
36 return FSMONITOR_REASON_OK;