Skip to content

Commit daea282

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Enable the built-in FSMonitor as an experimental feature
If `feature.experimental` and `feature.manyFiles` are set, we now start the built-in FSMonitor by default. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c56fc4c commit daea282

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

repo-settings.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
#include "config.h"
33
#include "repository.h"
44
#include "midx.h"
5+
#include "fsmonitor-ipc.h"
56

67
#define UPDATE_DEFAULT_BOOL(s,v) do { if (s == -1) { s = v; } } while(0)
78

89
void prepare_repo_settings(struct repository *r)
910
{
10-
int value;
11+
int value, feature_many_files = 0;
1112
char *strval;
1213

1314
if (r->settings.initialized)
@@ -62,6 +63,7 @@ void prepare_repo_settings(struct repository *r)
6263
r->settings.use_builtin_fsmonitor = 1;
6364

6465
if (!repo_config_get_bool(r, "feature.manyfiles", &value) && value) {
66+
feature_many_files = 1;
6567
UPDATE_DEFAULT_BOOL(r->settings.index_version, 4);
6668
UPDATE_DEFAULT_BOOL(r->settings.core_untracked_cache, UNTRACKED_CACHE_WRITE);
6769
}
@@ -70,8 +72,12 @@ void prepare_repo_settings(struct repository *r)
7072
r->settings.fetch_write_commit_graph = value;
7173
UPDATE_DEFAULT_BOOL(r->settings.fetch_write_commit_graph, 0);
7274

73-
if (!repo_config_get_bool(r, "feature.experimental", &value) && value)
75+
if (!repo_config_get_bool(r, "feature.experimental", &value) && value) {
7476
UPDATE_DEFAULT_BOOL(r->settings.fetch_negotiation_algorithm, FETCH_NEGOTIATION_SKIPPING);
77+
if (feature_many_files && fsmonitor_ipc__is_supported())
78+
UPDATE_DEFAULT_BOOL(r->settings.use_builtin_fsmonitor,
79+
1);
80+
}
7581

7682
/* Hack for test programs like test-dump-untracked-cache */
7783
if (ignore_untracked_cache_config)

0 commit comments

Comments
 (0)