Skip to content

Commit f8819fa

Browse files
committed
Merge branch 'scalar-reconfigure'
This allows fixing settings after a Scalar upgrade, or after botching the enlistments configuration. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 4e4afbe + 90d4293 commit f8819fa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scalar.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,23 @@ static int set_recommended_config(int reconfigure)
199199
int i;
200200
char *value;
201201

202+
/*
203+
* If a user has "core.usebuiltinfsmonitor" enabled, try to switch to
204+
* the new (non-deprecated) setting (core.fsmonitor).
205+
*/
206+
if (!git_config_get_string("core.usebuiltinfsmonitor", &value)) {
207+
char *dummy = NULL;
208+
if (git_config_get_string("core.fsmonitor", &dummy) &&
209+
git_config_set_gently("core.fsmonitor", value) < 0)
210+
return error(_("could not configure %s=%s"),
211+
"core.fsmonitor", value);
212+
if (git_config_set_gently("core.usebuiltinfsmonitor", NULL) < 0)
213+
return error(_("could not configure %s=%s"),
214+
"core.useBuiltinFSMonitor", "NULL");
215+
free(value);
216+
free(dummy);
217+
}
218+
202219
for (i = 0; config[i].key; i++) {
203220
if (set_scalar_config(config + i, reconfigure))
204221
return error(_("could not configure %s=%s"),

0 commit comments

Comments
 (0)