diff options
| author | Linus Arver <linus@ucla.edu> | 2024-05-02 04:54:26 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-02 09:57:08 -0700 |
| commit | 5f800603a9fa0cbcca83b3eb56dff893582d0ca7 (patch) | |
| tree | 6a53a6a5ea62e7e8c45cf4a95630f5e589805f8a /trailer.c | |
| parent | cf5c9349de52d8d5fa02f7a5b6d9122260834f26 (diff) | |
| download | git-5f800603a9fa0cbcca83b3eb56dff893582d0ca7.tar.xz | |
trailer: document parse_trailers() usage
Explain how to use parse_trailers(), because earlier we made the
trailer_info struct opaque. That is, because clients can no longer peek
inside it, we should give them guidance about how the (pointer to the)
opaque struct can still be useful to them.
Rename "head" struct to "trailer_objects" to make the wording of the new
comments a bit easier to read (because "head" itself doesn't really have
any domain-specific meaning here).
Signed-off-by: Linus Arver <linus@ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trailer.c')
| -rw-r--r-- | trailer.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1026,12 +1026,12 @@ static struct trailer_info *trailer_info_get(const struct process_trailer_option } /* - * Parse trailers in "str", populating the trailer info and "head" + * Parse trailers in "str", populating the trailer info and "trailer_objects" * linked list structure. */ struct trailer_info *parse_trailers(const struct process_trailer_options *opts, const char *str, - struct list_head *head) + struct list_head *trailer_objects) { struct trailer_info *info; struct strbuf tok = STRBUF_INIT; @@ -1051,13 +1051,13 @@ struct trailer_info *parse_trailers(const struct process_trailer_options *opts, separator_pos); if (opts->unfold) unfold_value(&val); - add_trailer_item(head, + add_trailer_item(trailer_objects, strbuf_detach(&tok, NULL), strbuf_detach(&val, NULL)); } else if (!opts->only_trailers) { strbuf_addstr(&val, trailer); strbuf_strip_suffix(&val, "\n"); - add_trailer_item(head, + add_trailer_item(trailer_objects, NULL, strbuf_detach(&val, NULL)); } |
