Skip to content

Commit 4f760b7

Browse files
committed
Merge branch 'lt/bool-on-off'
* lt/bool-on-off: Documentation: boolean value may be given by on/off Allow users to un-configure rename detection
2 parents 9824a38 + 0cbcf7a commit 4f760b7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Internal whitespace within a variable value is retained verbatim.
6161

6262
The values following the equals sign in variable assign are all either
6363
a string, an integer, or a boolean. Boolean values may be given as yes/no,
64-
0/1 or true/false. Case is not significant in boolean values, when
64+
0/1, true/false or on/off. Case is not significant in boolean values, when
6565
converting value to the canonical form using '--bool' type specifier;
6666
'git-config' will ensure that the output is "true" or "false".
6767

config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
331331
return 1;
332332
if (!*value)
333333
return 0;
334-
if (!strcasecmp(value, "true") || !strcasecmp(value, "yes"))
334+
if (!strcasecmp(value, "true") || !strcasecmp(value, "yes") || !strcasecmp(value, "on"))
335335
return 1;
336-
if (!strcasecmp(value, "false") || !strcasecmp(value, "no"))
336+
if (!strcasecmp(value, "false") || !strcasecmp(value, "no") || !strcasecmp(value, "off"))
337337
return 0;
338338
*is_bool = 0;
339339
return git_config_int(name, value);

0 commit comments

Comments
 (0)