Skip to content

Commit 26e4172

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 <johannes.schindelin@gmx.de>
2 parents 9ce71df + cc28b25 commit 26e4172

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
@@ -183,6 +183,23 @@ static int set_recommended_config(int reconfigure)
183183
int i;
184184
char *value;
185185

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

0 commit comments

Comments
 (0)