Thread (16 messages) flat view 16 messages, 6 authors, 2021-07-10
STALE1862d

[PATCH 4/5] config: initialize origin_type correctly

From: Felipe Contreras <hidden>
Date: 2021-07-02 10:05:20
Subsystem: the rest · Maintainer: Linus Torvalds

cf->origin_type either is CONFIG_ORIGIN_CMDLINE, or it's something else.

Don't override that.

Signed-off-by: Felipe Contreras <redacted>
---
 config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/config.c b/config.c
index 9172c96c54..666fb2c689 100644
--- a/config.c
+++ b/config.c
@@ -2087,13 +2087,12 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha
 	if (cf->name) {
 		kv_info->filename = strintern(cf->name);
 		kv_info->linenr = cf->linenr;
-		kv_info->origin_type = cf->origin_type;
 	} else {
 		/* for values read from `git_config_from_parameters()` */
 		kv_info->filename = NULL;
 		kv_info->linenr = -1;
-		kv_info->origin_type = CONFIG_ORIGIN_CMDLINE;
 	}
+	kv_info->origin_type = cf->origin_type;
 	kv_info->scope = current_parsing_scope;
 	si->util = kv_info;
 
-- 
2.32.0.94.g4574ca548c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help