diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2022-05-27 00:46:58 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-27 01:59:26 +0300 |
commit | 62a62a28308453ee830bb7e02cf732474a6e01a5 (patch) | |
tree | bb7a65a5e3e244b804a4089cb984d506b3e2736a /builtin/update-index.c | |
parent | 49b398a970f6efa368114330da23ae69aeeb9c60 (diff) |
fsmonitor-settings: bare repos are incompatible with FSMonitor
Bare repos do not have a worktree, so there is nothing for the
daemon watch.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r-- | builtin/update-index.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c index 876112abb2..01ed4c4976 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -1237,6 +1237,22 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) if (fsmonitor > 0) { enum fsmonitor_mode fsm_mode = fsm_settings__get_mode(r); + enum fsmonitor_reason reason = fsm_settings__get_reason(r); + + /* + * The user wants to turn on FSMonitor using the command + * line argument. (We don't know (or care) whether that + * is the IPC or HOOK version.) + * + * Use one of the __get routines to force load the FSMonitor + * config settings into the repo-settings. That will detect + * whether the file system is compatible so that we can stop + * here with a nice error message. + */ + if (reason > FSMONITOR_REASON_OK) + die("%s", + fsm_settings__get_incompatible_msg(r, reason)); + if (fsm_mode == FSMONITOR_MODE_DISABLED) { warning(_("core.fsmonitor is unset; " "set it if you really want to " |