|
2 | 2 | #include "config.h"
|
3 | 3 | #include "repository.h"
|
4 | 4 | #include "midx.h"
|
5 |
| -#include "compat/fsmonitor/fsm-listen.h" |
| 5 | +#include "fsmonitor-ipc.h" |
| 6 | +#include "fsmonitor-settings.h" |
6 | 7 |
|
7 | 8 | static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
|
8 | 9 | int def)
|
@@ -44,6 +45,30 @@ void prepare_repo_settings(struct repository *r)
|
44 | 45 | if (experimental) {
|
45 | 46 | r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
|
46 | 47 | r->settings.gc_cruft_packs = 1;
|
| 48 | + |
| 49 | + /* |
| 50 | + * Force enable the builtin FSMonitor (unless the repo |
| 51 | + * is incompatible or they've already selected it or |
| 52 | + * the hook version). But only if they haven't |
| 53 | + * explicitly turned it off -- so only if our config |
| 54 | + * value is UNSET. |
| 55 | + * |
| 56 | + * lookup_fsmonitor_settings() and check_for_ipc() do |
| 57 | + * not distinguish between explicitly set FALSE and |
| 58 | + * UNSET, so we re-test for an UNSET config key here. |
| 59 | + * |
| 60 | + * I'm not sure I want to fix fsmonitor-settings.c to |
| 61 | + * have more than one _DISABLED state since our usage |
| 62 | + * here is only to support this experimental period |
| 63 | + * (and I don't want to overload the _reason field |
| 64 | + * because it describes incompabilities). |
| 65 | + */ |
| 66 | + if (manyfiles && |
| 67 | + fsmonitor_ipc__is_supported() && |
| 68 | + fsm_settings__get_mode(r) == FSMONITOR_MODE_DISABLED && |
| 69 | + repo_config_get_maybe_bool(r, "core.fsmonitor", &value) > 0 && |
| 70 | + repo_config_get_bool(r, "core.useBuiltinFSMonitor", &value)) |
| 71 | + fsm_settings__set_ipc(r); |
47 | 72 | }
|
48 | 73 | if (manyfiles) {
|
49 | 74 | r->settings.index_version = 4;
|
|
0 commit comments