[PATCH v4 04/29] trailer: move config_head and arg_head to if storage
- From
Li Chen <me@linux.beauty>
- Date
- Oct 14, 2025, 12:24 UTC
- Message-ID
- <20251014122452.1851103-5-me@linux.beauty>
- In-Reply-To
- <20251014122452.1851103-1-me@linux.beauty>
From: Li Chen <chenl311@chinatelecom.cn>
Move LIST_HEAD(config_head) and LIST_HEAD(arg_head) into the non-only_input branch so they are created only when needed. No functional change.
Signed-off-by: Li Chen <chenl311@chinatelecom.cn> --- trailer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/trailer.c b/trailer.c index 42ac6f58a2..3169e315c0 100644 --- a/trailer.c +++ b/trailer.c @@ -1265,14 +1265,15 @@ int trailer_process(const struct process_trailer_options *opts, { struct trailer_block *blk; LIST_HEAD(orig_head); - LIST_HEAD(config_head); - LIST_HEAD(arg_head); struct strbuf trailers_sb = STRBUF_INIT; int had_trailer_before; blk = parse_trailers(opts, msg, &orig_head); had_trailer_before = !list_empty(&orig_head); if (!opts->only_input) { + LIST_HEAD(config_head); + LIST_HEAD(arg_head); + parse_trailers_from_config(&config_head); parse_trailers_from_command_line_args(&arg_head, new_trailer_head); list_splice(&config_head, &arg_head);
-- 2.51.0