diff options
author | Jeff King <peff@peff.net> | 2018-08-22 20:46:23 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-23 10:08:51 -0700 |
commit | 00a21f5cbda35eb5d355b453849b625eeca7eac4 (patch) | |
tree | 2307ca3358c0fecd27f88d56f64d050566717273 /trailer.c | |
parent | a3b636e21574e6cff1494e0a84644e06201ddb8d (diff) | |
download | git-00a21f5cbda35eb5d355b453849b625eeca7eac4.tar.gz |
trailer: pass process_trailer_opts to trailer_info_get()
Most of the trailer code has an "opts" struct which is
filled in by the caller. We don't pass it down to
trailer_info_get(), which does the initial parsing, because
there hasn't yet been a need to do so.
Let's start passing it down in preparation for adding new
options. Note that there's a single caller which doesn't
otherwise have such an options struct. Since it's just one
caller (that we'd have to modify anyway), let's not bother
with any special treatment like accepting a NULL options
struct, and just have it allocate one with the defaults.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trailer.c')
-rw-r--r-- | trailer.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -950,7 +950,7 @@ static size_t process_input_file(FILE *outfile, struct strbuf val = STRBUF_INIT; size_t i; - trailer_info_get(&info, str); + trailer_info_get(&info, str, opts); /* Print lines before the trailers as is */ if (!opts->only_trailers) @@ -1067,7 +1067,8 @@ void process_trailers(const char *file, strbuf_release(&sb); } -void trailer_info_get(struct trailer_info *info, const char *str) +void trailer_info_get(struct trailer_info *info, const char *str, + const struct process_trailer_options *opts) { int patch_start, trailer_end, trailer_start; struct strbuf **trailer_lines, **ptr; @@ -1159,7 +1160,7 @@ void format_trailers_from_commit(struct strbuf *out, const char *msg, { struct trailer_info info; - trailer_info_get(&info, msg); + trailer_info_get(&info, msg, opts); format_trailer_info(out, &info, opts); trailer_info_release(&info); } |