sequencer: use the trailer iterator
commit2ade05431ebfc8c159a00202c44580754c7d42e2
authorLinus Arver <linus@ucla.edu>
Thu, 2 May 2024 04:54:21 +0000 (2 04:54 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 May 2024 16:57:08 +0000 (2 09:57 -0700)
tree8ce28fe39ff3c41417fd50a7ba2ab5215d90a9f4
parent3be65e6ee2f585a0aad0363c8ce7d966a6f8c2b3
sequencer: use the trailer iterator

Instead of calling "trailer_info_get()", which is a low-level function
in the trailers implementation (trailer.c), call
trailer_iterator_advance(), which was specifically designed for public
consumption in f0939a0eb1 (trailer: add interface for iterating over
commit trailers, 2020-09-27).

Avoiding "trailer_info_get()" means we don't have to worry about options
like "no_divider" (relevant for parsing trailers). We also don't have to
check for things like "info.trailer_start == info.trailer_end" to see
whether there were any trailers (instead we can just check to see
whether the iterator advanced at all).

Note how we have to use "iter.raw" in order to get the same behavior as
before when we iterated over the unparsed string array (char **trailers)
in trailer_info.

Signed-off-by: Linus Arver <linus@ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c