config: consistent error messages

This commit is contained in:
Edward Thomson
2026-01-11 01:01:21 +00:00
parent 6d63f4b63a
commit 8fe2c189e5

View File

@@ -1442,14 +1442,12 @@ int git_config_parse_bool(int *out, const char *value)
if (git__parse_bool(out, value) == 0)
return 0;
/* git__parse_bool returns 0 for NULL, so this assertion should be correct */
GIT_ASSERT_ARG(value);
if (git_config_parse_int32(out, value) == 0) {
*out = !!(*out);
return 0;
}
git_error_set(GIT_ERROR_CONFIG, "failed to parse '%s' as a boolean value", value);
git_error_set(GIT_ERROR_CONFIG, "failed to parse '%s' as a boolean", value ? value : "(null)");
return -1;
}