fetch: move reference width calculation into `display_state`
commitce9636d645714974e5f7e1e9abc65fa57186b147
authorPatrick Steinhardt <ps@pks.im>
Mon, 20 Mar 2023 12:35:20 +0000 (20 13:35 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 18:02:43 +0000 (20 11:02 -0700)
treeacd0f09ee8631daf8f991b18be927894579e3ebc
parent73876f4861cd3d187a4682290ab75c9dccadbc56
fetch: move reference width calculation into `display_state`

In order to print references in proper columns we need to calculate the
width of the reference column before starting to print the references.
This is done with the help of a global variable `refcol_width`.

Refactor the code to instead use a new structure `display_state` that
contains the computed width and plumb it through the stack as required.
This is only the first step towards de-globalizing the state required to
print references.

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