summaryrefslogtreecommitdiff
path: root/pretty.h
diff options
context:
space:
mode:
authorHariom Verma <hariom18599@gmail.com>2021-02-13 01:52:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-16 00:48:38 (GMT)
commit90563aedcab92b75d4b5f6d7aa43d6a98aaccde6 (patch)
tree44bc77ca31f02efa138df9cee5505962c593938a /pretty.h
parent727331dce16d88735a5e3a8050b1520d03c6e77a (diff)
downloadgit-90563aedcab92b75d4b5f6d7aa43d6a98aaccde6.zip
git-90563aedcab92b75d4b5f6d7aa43d6a98aaccde6.tar.gz
git-90563aedcab92b75d4b5f6d7aa43d6a98aaccde6.tar.bz2
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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/pretty.h b/pretty.h
index 7ce6c0b..7369cf7 100644
--- a/pretty.h
+++ b/pretty.h
@@ -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 */