diff mbox series

[2/5] format_trailer_info(): drop redundant unfold_value()

Message ID 5f9e444197468d065264b85c8cf7434df0e08070.1710485706.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 41ea0a900221897c5ba36afb9f0b31bf543cea7e
Headers show
Series Unify trailer formatting functions | expand

Commit Message

Linus Arver March 15, 2024, 6:55 a.m. UTC
From: Linus Arver <linusa@google.com>

This is another preparatory refactor to unify the trailer formatters.

In the last patch we made format_trailer_info() use trailer_item objects
instead of the "trailers" string array. This means that the call to
unfold_value() here is redundant because the trailer_item objects are
already unfolded in parse_trailers() which is a dependency of our
caller, format_trailers_from_commit().

Remove the redundant call.

Signed-off-by: Linus Arver <linusa@google.com>
---
 trailer.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/trailer.c b/trailer.c
index a74f05db55c..2c0dd8ac829 100644
--- a/trailer.c
+++ b/trailer.c
@@ -1101,9 +1101,6 @@  static void format_trailer_info(const struct process_trailer_options *opts,
 			strbuf_addstr(&val, item->value);
 
 			if (!opts->filter || opts->filter(&tok, opts->filter_data)) {
-				if (opts->unfold)
-					unfold_value(&val);
-
 				if (opts->separator && out->len != origlen)
 					strbuf_addbuf(out, opts->separator);
 				if (!opts->value_only)