]> git.ipfire.org Git - thirdparty/git.git/commit
trailer: move interpret_trailers() to interpret-trailers.c
authorLinus Arver <linusa@google.com>
Fri, 1 Mar 2024 00:14:41 +0000 (00:14 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Mar 2024 18:35:42 +0000 (10:35 -0800)
commitae0ec2e0e0bb26474f395504c6ed6fef3f59091f
tree737f05614fb0b160319e26e4d1f7bd8e7738a896
parent0383dc5629dc4416b6564e5b458d174d770ef191
trailer: move interpret_trailers() to interpret-trailers.c

The interpret-trailers.c builtin is the only place we need to call
interpret_trailers(), so move its definition there (together with a few
helper functions called only by it) and remove its external declaration
from <trailer.h>.

Several helper functions that are called by interpret_trailers() remain
in trailer.c because other callers in the same file still call them.
Declare them in <trailer.h> so that interpret_trailers() (now in
builtin/interpret-trailers.c) can continue calling them as a trailer API
user.

This enriches <trailer.h> with a more granular API, which can then be
unit-tested in the future (because interpret_trailers() by itself does
too many things to be able to be easily unit-tested).

Take this opportunity to demote some file-handling functions out of the
trailer API implementation, as these have nothing to do with trailers.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/interpret-trailers.c
trailer.c
trailer.h