fetch: centralize printing of reference updates
commitd6606e02aaff963f51fe9cbda048613ff0cd5870
authorPatrick Steinhardt <ps@pks.im>
Mon, 20 Mar 2023 12:35:40 +0000 (20 13:35 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 18:02:43 +0000 (20 11:02 -0700)
tree7ca5b18f2bd385279ee66ee43afa7d27c67267ff
parentc4ef5edbc952302097d6a55ac490bad7726bf840
fetch: centralize printing of reference updates

In order to print updated references during a fetch, the two different
call sites that do this will first call `format_display()` followed by a
call to `fputs()`. This is needlessly roundabout now that we have the
`display_state` structure that encapsulates all of the printing logic
for references.

Move displaying the reference updates into `format_display()` and rename
it to `display_ref_update()` to better match its new purpose, which
finalizes the conversion to make both the formatting and printing logic
of reference updates self-contained. This will make it easier to add new
output formats and printing to a different file descriptor than stderr.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c