Skip to content

Commit 16e4466

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 ca816cf + 0e4af21 commit 16e4466

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
@@ -188,6 +188,23 @@ static int set_recommended_config(int reconfigure)
188188
int i;
189189
char *value;
190190

191+
/*
192+
* If a user has "core.usebuiltinfsmonitor" enabled, try to switch to
193+
* the new (non-deprecated) setting (core.fsmonitor).
194+
*/
195+
if (!git_config_get_string("core.usebuiltinfsmonitor", &value)) {
196+
char *dummy = NULL;
197+
if (git_config_get_string("core.fsmonitor", &dummy) &&
198+
git_config_set_gently("core.fsmonitor", value) < 0)
199+
return error(_("could not configure %s=%s"),
200+
"core.fsmonitor", value);
201+
if (git_config_set_gently("core.usebuiltinfsmonitor", NULL) < 0)
202+
return error(_("could not configure %s=%s"),
203+
"core.useBuiltinFSMonitor", "NULL");
204+
free(value);
205+
free(dummy);
206+
}
207+
191208
for (i = 0; config[i].key; i++) {
192209
if (set_scalar_config(config + i, reconfigure))
193210
return error(_("could not configure %s=%s"),

0 commit comments

Comments
 (0)