diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-03-20 13:35:32 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-20 11:02:43 -0700 |
commit | 331b7d29f05b62fc73f1218e0e6db6969481a3cd (patch) | |
tree | ec4b1ebda5ed482ed431ca824a93c87fc8deb7be /merge-blobs.c | |
parent | 7c978db889f2a0eddf0799268f57b9457ef9ab3d (diff) |
fetch: centralize handling of per-reference format
The function `format_display()` is used to print a single reference
update to a buffer which will then ultimately be printed by the caller.
This architecture causes us to duplicate some logic across the different
callsites of this function. This makes it hard to follow the code as
some parts of the logic are located in one place, while other parts of
the logic are located in a different place. Furthermore, by having the
logic scattered around it becomes quite hard to implement a new output
format for the reference updates.
We can make the logic a whole lot easier to understand by making the
`format_display()` function self-contained so that it handles formatting
and printing of the references. This will eventually allow us to easily
implement a completely different output format, but also opens the door
to conditionally print to either stdout or stderr depending on the
output format.
As a first step towards that goal we move the formatting directive used
by both callers to print a single reference update into this function.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-blobs.c')
0 files changed, 0 insertions, 0 deletions