fetch: pass the full local reference name to `format_display`
commit7c978db889f2a0eddf0799268f57b9457ef9ab3d
authorPatrick Steinhardt <ps@pks.im>
Mon, 20 Mar 2023 12:35:28 +0000 (20 13:35 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 18:02:43 +0000 (20 11:02 -0700)
tree09752156876c37cd80b8e6e52ceadfc356eddceb
parent5cab51ff7156edca8cb9eba30205efa11900e49c
fetch: pass the full local reference name to `format_display`

Before printing the name of the local references that would be updated
by a fetch we first prettify the reference name. This is done at the
calling side so that `format_display()` never sees the full name of the
local reference. This restricts our ability to introduce new output
formats that might want to print the full reference name.

Right now, all callsites except one are prettifying the reference name
anyway. And the only callsite that doesn't passes `FETCH_HEAD` as the
hardcoded reference name to `format_display()`, which would never be
changed by a call to `prettify_refname()` anyway. So let's refactor the
code to pass in the full local reference name and then prettify it in
the formatting code.

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