Thread (32 messages) 32 messages, 5 authors, 2023-10-23
STALE1072d

Revision v2 of 2 in this series.

Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 3/4] config.c: accept config_parse_options in git_config_from_stdin

From: Josh Steadmon <hidden>
Date: 2023-08-23 21:54:58
Subsystem: the rest · Maintainer: Linus Torvalds

From: Glen Choo <redacted>

A later commit will move git_config_from_stdin() to a library, so it
will need to accept event listeners.

Signed-off-by: Glen Choo <redacted>
Signed-off-by: Josh Steadmon <redacted>
---
 config.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/config.c b/config.c
index 6cf4dafc6c..40cc9dbc40 100644
--- a/config.c
+++ b/config.c
@@ -2024,12 +2024,11 @@ static int do_config_from_file(config_fn_t fn,
 }
 
 static int git_config_from_stdin(config_fn_t fn, void *data,
-				 enum config_scope scope)
+				 enum config_scope scope,
+				 const struct config_parse_options *config_opts)
 {
-	struct config_parse_options config_opts = CP_OPTS_INIT(CONFIG_ERROR_DIE);
-
 	return do_config_from_file(fn, CONFIG_ORIGIN_STDIN, "", NULL, stdin,
-				   data, scope, &config_opts);
+				   data, scope, config_opts);
 }
 
 int git_config_from_file_with_options(config_fn_t fn, const char *filename,
@@ -2264,7 +2263,8 @@ int config_with_options(config_fn_t fn, void *data,
 	 * regular lookup sequence.
 	 */
 	if (config_source && config_source->use_stdin) {
-		ret = git_config_from_stdin(fn, data, config_source->scope);
+		ret = git_config_from_stdin(fn, data, config_source->scope,
+					    &opts->parse_options);
 	} else if (config_source && config_source->file) {
 		ret = git_config_from_file_with_options(fn, config_source->file,
 							data, config_source->scope,
-- 
2.42.0.rc1.204.g551eb34607-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help