Skip to content

Commit bf43be8

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 4a4ede4 + cdbd96b commit bf43be8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

scalar.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,23 @@ static int set_recommended_config(int reconfigure)
200200
int i;
201201
char *value;
202202

203+
/*
204+
* If a user has "core.usebuiltinfsmonitor" enabled, try to switch to
205+
* the new (non-deprecated) setting (core.fsmonitor).
206+
*/
207+
if (!git_config_get_string("core.usebuiltinfsmonitor", &value)) {
208+
char *dummy = NULL;
209+
if (git_config_get_string("core.fsmonitor", &dummy) &&
210+
git_config_set_gently("core.fsmonitor", value) < 0)
211+
return error(_("could not configure %s=%s"),
212+
"core.fsmonitor", value);
213+
if (git_config_set_gently("core.usebuiltinfsmonitor", NULL) < 0)
214+
return error(_("could not configure %s=%s"),
215+
"core.useBuiltinFSMonitor", "NULL");
216+
free(value);
217+
free(dummy);
218+
}
219+
203220
for (i = 0; config[i].key; i++) {
204221
if (set_scalar_config(config + i, reconfigure))
205222
return error(_("could not configure %s=%s"),
@@ -1141,7 +1158,8 @@ static int cmd_reconfigure(int argc, const char **argv)
11411158
old_repo = the_repository;
11421159
the_repository = &r;
11431160

1144-
if (set_recommended_config(1) >= 0)
1161+
if (set_recommended_config(1) >= 0 &&
1162+
toggle_maintenance(1) >= 0)
11451163
succeeded = 1;
11461164

11471165
the_repository = old_repo;

0 commit comments

Comments
 (0)