diff options
author | Taylor Blau <me@ttaylorr.com> | 2017-10-01 22:25:24 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-02 21:15:30 +0900 |
commit | 7a5edbdb748f58c0ff3f2a459596ad6ddfda0640 (patch) | |
tree | 644b598f8b71e6e0c452876b23d8e8cf6a4b6ac4 /tag.c | |
parent | ref-filter.c: use trailer_opts to format trailers (diff) | |
download | tgif-7a5edbdb748f58c0ff3f2a459596ad6ddfda0640.tar.xz |
ref-filter.c: parse trailers arguments with %(contents) atom
The %(contents) atom takes a contents "field" as its argument. Since
"trailers" is one of those fields, extend contents_atom_parser to parse
"trailers"'s arguments when used through "%(contents)", like:
%(contents:trailers:unfold,only)
A caveat: trailers_atom_parser expects NULL when no arguments are given
(see: `parse_ref_filter_atom`). This is because string_list_split (given
a maxsplit of -1) returns a 1-ary string_list* containing the given
string if the delimiter could not be found using `strchr`.
To simulate this behavior without teaching trailers_atom_parser to
accept strings with length zero, conditionally pass NULL to
trailers_atom_parser if the arguments portion of the argument to
%(contents) is empty.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tag.c')
0 files changed, 0 insertions, 0 deletions