diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-03 00:30:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-03 00:30:39 +0200 |
commit | bd1a32d5c8ec5987824acb63694361d082ce9092 (patch) | |
tree | 2d4cdf74b1f280cb9585af314928a2396763b65e /config.h | |
parent | Merge branch 'bc/object-id' (diff) | |
parent | fsck: downgrade gitmodulesParse default to "info" (diff) | |
download | git-bd1a32d5c8ec5987824acb63694361d082ce9092.tar.xz git-bd1a32d5c8ec5987824acb63694361d082ce9092.zip |
Merge branch 'jk/fsck-gitmodules-gently'
Recent "security fix" to pay attention to contents of ".gitmodules"
while accepting "git push" was a bit overly strict than necessary,
which has been adjusted.
* jk/fsck-gitmodules-gently:
fsck: downgrade gitmodulesParse default to "info"
fsck: split ".gitmodules too large" error from parse failure
fsck: silence stderr when parsing .gitmodules
config: add options parameter to git_config_from_mem
config: add CONFIG_ERROR_SILENT handler
config: turn die_on_error into caller-facing enum
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -54,6 +54,12 @@ 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 */ + CONFIG_ERROR_SILENT, /* return -1 */ + } error_action; }; typedef int (*config_fn_t)(const char *, const char *, void *); @@ -62,8 +68,11 @@ extern int git_config_from_file(config_fn_t fn, const char *, void *); extern int git_config_from_file_with_options(config_fn_t fn, const char *, void *, const struct config_options *); -extern int git_config_from_mem(config_fn_t fn, const enum config_origin_type, - const char *name, const char *buf, size_t len, void *data); +extern int git_config_from_mem(config_fn_t fn, + const enum config_origin_type, + const char *name, + const char *buf, size_t len, + void *data, const struct config_options *opts); extern int git_config_from_blob_oid(config_fn_t fn, const char *name, const struct object_id *oid, void *data); extern void git_config_push_parameter(const char *text); |