diff options
author | Hariom Verma <hariom18599@gmail.com> | 2021-02-13 02:52:41 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-16 01:48:38 +0100 |
commit | 90563aedcab92b75d4b5f6d7aa43d6a98aaccde6 (patch) | |
tree | 44bc77ca31f02efa138df9cee5505962c593938a /pretty.h | |
parent | t6300: use function to test trailer options (diff) | |
download | git-90563aedcab92b75d4b5f6d7aa43d6a98aaccde6.tar.xz git-90563aedcab92b75d4b5f6d7aa43d6a98aaccde6.zip |
pretty.c: refactor trailer logic to `format_set_trailers_options()`
Refactored trailers formatting logic inside pretty.c to a new function
`format_set_trailers_options()`. This new function returns the non-zero
in case of unusual. The caller handles the non-zero by "goto trailers_out".
This change will allow us to reuse the same logic in other places.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Heba Waly <heba.waly@gmail.com>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.h')
-rw-r--r-- | pretty.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -6,6 +6,7 @@ struct commit; struct strbuf; +struct process_trailer_options; /* Commit formats */ enum cmit_fmt { @@ -142,4 +143,14 @@ int commit_format_is_empty(enum cmit_fmt); /* Make subject of commit message suitable for filename */ void format_sanitized_subject(struct strbuf *sb, const char *msg, size_t len); +/* + * Set values of fields in "struct process_trailer_options" + * according to trailers arguments. + */ +int format_set_trailers_options(struct process_trailer_options *opts, + struct string_list *filter_list, + struct strbuf *sepbuf, + struct strbuf *kvsepbuf, + const char **arg); + #endif /* PRETTY_H */ |