diff options
| author | Linus Arver <linusa@google.com> | 2024-03-15 06:55:04 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-15 10:10:25 -0700 |
| commit | 676c1db76e310c400b602890ac6853fdf8fdfa98 (patch) | |
| tree | 0ae44e598adcf3d93f74a15e677c389fc2bf329b /builtin/interpret-trailers.c | |
| parent | 9f0c9702de9c87aa30697d88c4dc9ad0610f4201 (diff) | |
| download | git-676c1db76e310c400b602890ac6853fdf8fdfa98.tar.xz | |
trailer: begin formatting unification
Now that the preparatory refactors are over, we can replace the call to
format_trailers() in interpret-trailers with format_trailer_info(). This
unifies the trailer formatting machinery
In order to avoid breakages in t7502 and t7513, we have to steal the
features present in format_trailers(). Namely, we have to teach
format_trailer_info() as follows:
(1) make it aware of opts->trim_empty, and
(2) make it avoid hardcoding ": " as the separator and space (which
can result in double-printing these characters).
For (2), make it only print the separator and space if we cannot find
any recognized separator somewhere in the key (yes, keys may have a
trailing separator in it --- we will eventually fix this design but not
now). Do so by copying the code out of print_tok_val(), and deleting the
same function.
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/interpret-trailers.c')
| -rw-r--r-- | builtin/interpret-trailers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c index 11f4ce9e4a..f57af0db37 100644 --- a/builtin/interpret-trailers.c +++ b/builtin/interpret-trailers.c @@ -171,7 +171,7 @@ static void interpret_trailers(const struct process_trailer_options *opts, } /* Print trailer block. */ - format_trailers(opts, &head, &trailer_block); + format_trailer_info(opts, &head, &trailer_block); free_trailers(&head); fwrite(trailer_block.buf, 1, trailer_block.len, outfile); strbuf_release(&trailer_block); |
