summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-08-02 15:30:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-02 15:30:39 -0700
commitbd1a32d5c8ec5987824acb63694361d082ce9092 (patch)
tree2d4cdf74b1f280cb9585af314928a2396763b65e /config.h
parentMerge branch 'bc/object-id' (diff)
parentfsck: downgrade gitmodulesParse default to "info" (diff)
downloadtgif-bd1a32d5c8ec5987824acb63694361d082ce9092.tar.xz
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.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/config.h b/config.h
index b95bb7649d..bb2f506b27 100644
--- a/config.h
+++ b/config.h
@@ -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);