summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-06-28 18:05:24 -0400
committerJunio C Hamano <gitster@pobox.com>2018-07-03 09:36:06 -0700
commit4574f1aace4ca53ac0fc63a545383dab1a71fec9 (patch)
treeb511f639027fe89aecc1558da227d85fcf6f69ba /config.c
parent63583203df51c645aa2bf2988bbdfa3d308ef517 (diff)
downloadgit-4574f1aace4ca53ac0fc63a545383dab1a71fec9.tar.gz
git-4574f1aace4ca53ac0fc63a545383dab1a71fec9.tar.xz
config: add options parameter to git_config_from_mem
The underlying config parser knows how to handle a config_options struct, but git_config_from_mem() always passes NULL. Let's allow our callers to specify the options struct. We could add a "_with_options" variant, but since there are only a handful of callers, let's just update them to pass NULL. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/config.c b/config.c
index ce02ceaf9..60132e377 100644
--- a/config.c
+++ b/config.c
@@ -1569,8 +1569,10 @@ int git_config_from_file(config_fn_t fn, const char *filename, void *data)
return git_config_from_file_with_options(fn, filename, data, NULL);
}
-int git_config_from_mem(config_fn_t fn, const enum config_origin_type origin_type,
- const char *name, const char *buf, size_t len, void *data)
+int git_config_from_mem(config_fn_t fn,
+ const enum config_origin_type origin_type,
+ const char *name, const char *buf, size_t len,
+ void *data, const struct config_options *opts)
{
struct config_source top;
@@ -1585,7 +1587,7 @@ int git_config_from_mem(config_fn_t fn, const enum config_origin_type origin_typ
top.do_ungetc = config_buf_ungetc;
top.do_ftell = config_buf_ftell;
- return do_config_from(&top, fn, data, NULL);
+ return do_config_from(&top, fn, data, opts);
}
int git_config_from_blob_oid(config_fn_t fn,
@@ -1606,7 +1608,8 @@ int git_config_from_blob_oid(config_fn_t fn,
return error("reference '%s' does not point to a blob", name);
}
- ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size, data);
+ ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size,
+ data, NULL);
free(buf);
return ret;