treewide: deprecate git_config_maybe_bool, use git_parse_maybe_bool
The only difference between these is that the former takes an argument `name` which it ignores completely. Still, the callers are quite careful to provide reasonable values for it. Once in-flight topics have landed, we should be able to remove git_config_maybe_bool. In the meantime, document it as deprecated in the technical documentation. While at it, document git_parse_maybe_bool. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
4666741823
commit
8957661378
@ -36,7 +36,7 @@ enum rebase_type {
|
||||
static enum rebase_type parse_config_rebase(const char *key, const char *value,
|
||||
int fatal)
|
||||
{
|
||||
int v = git_config_maybe_bool("pull.rebase", value);
|
||||
int v = git_parse_maybe_bool(value);
|
||||
|
||||
if (!v)
|
||||
return REBASE_FALSE;
|
||||
@ -271,7 +271,7 @@ static const char *config_get_ff(void)
|
||||
if (git_config_get_value("pull.ff", &value))
|
||||
return NULL;
|
||||
|
||||
switch (git_config_maybe_bool("pull.ff", value)) {
|
||||
switch (git_parse_maybe_bool(value)) {
|
||||
case 0:
|
||||
return "--no-ff";
|
||||
case 1:
|
||||
|
Reference in New Issue
Block a user