diff options
| author | Derrick Stolee <stolee@gmail.com> | 2026-02-23 12:26:44 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-23 13:23:40 -0800 |
| commit | 12210d034635e6e558f23505ef3edaedd870097e (patch) | |
| tree | b5c904761968143865918da78f4cf42f2383c90d /builtin | |
| parent | 25ede48b5406524d1a6b900e400f593c0b9a34dd (diff) | |
| download | git-12210d034635e6e558f23505ef3edaedd870097e.tar.xz | |
config: add 'gently' parameter to format_config()
This parameter is set to 0 for all current callers and is UNUSED.
However, we will start using this option in future changes and in a
critical change that requires gentle parsing (not using die()) to try
parsing all values in a list.
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/config.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/config.c b/builtin/config.c index 237f7a934d..b4c4228311 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -242,10 +242,14 @@ struct strbuf_list { * append it into strbuf `buf`. Returns a negative value on failure, * 0 on success, 1 on a missing optional value (i.e., telling the * caller to pretend that <key_,value_> did not exist). + * + * Note: 'gently' is currently ignored, but will be implemented in + * a future change. */ static int format_config(const struct config_display_options *opts, struct strbuf *buf, const char *key_, - const char *value_, const struct key_value_info *kvi) + const char *value_, const struct key_value_info *kvi, + int gently UNUSED) { if (opts->show_scope) show_config_scope(opts, kvi, buf); @@ -372,7 +376,7 @@ static int collect_config(const char *key_, const char *value_, strbuf_init(&values->items[values->nr], 0); status = format_config(data->display_opts, &values->items[values->nr++], - key_, value_, kvi); + key_, value_, kvi, 0); if (status < 0) return status; if (status) { @@ -463,7 +467,7 @@ static int get_value(const struct config_location_options *opts, strbuf_init(item, 0); status = format_config(display_opts, item, key_, - display_opts->default_value, &kvi); + display_opts->default_value, &kvi, 0); if (status < 0) die(_("failed to format default config value: %s"), display_opts->default_value); @@ -743,7 +747,7 @@ static int get_urlmatch(const struct config_location_options *opts, status = format_config(&display_opts, &buf, item->string, matched->value_is_null ? NULL : matched->value.buf, - &matched->kvi); + &matched->kvi, 0); if (!status) fwrite(buf.buf, 1, buf.len, stdout); strbuf_release(&buf); |
