diff options
author | Jeff King <peff@peff.net> | 2018-06-28 18:05:00 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 09:33:03 -0700 |
commit | 66f9722882993f60be656afaae4c5c9ac92957e9 (patch) | |
tree | 7e546e5510b69ec315fb92fb25838dba0d6793f8 /config.h | |
parent | e3331758f12da22f4103eec7efe1b5304a9be5e9 (diff) | |
download | git-66f9722882993f60be656afaae4c5c9ac92957e9.tar.gz |
config: turn die_on_error into caller-facing enum
The config code has a die_on_error flag, which lets us emit
an error() instead of dying when we see a bogus config file.
But there's no way for a caller of the config code to set
this: it's auto-set based on whether we're reading a file or
a blob.
Instead, let's add it to the config_options struct. When
it's not set (or we have no options) we'll continue to fall
back to the existing file/blob behavior.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -54,6 +54,11 @@ struct config_options { const char *git_dir; config_parser_event_fn_t event_fn; void *event_fn_data; + enum config_error_action { + CONFIG_ERROR_UNSET = 0, /* use source-specific default */ + CONFIG_ERROR_DIE, /* die() on error */ + CONFIG_ERROR_ERROR, /* error() on error, return -1 */ + } error_action; }; typedef int (*config_fn_t)(const char *, const char *, void *); |