summaryrefslogtreecommitdiff
path: root/merge-blobs.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2023-03-20 13:35:36 +0100
committerJunio C Hamano <gitster@pobox.com>2023-03-20 11:02:43 -0700
commitc4ef5edbc952302097d6a55ac490bad7726bf840 (patch)
treebacc18a8e1101b8811caf0d32d4558a257ca1439 /merge-blobs.c
parent331b7d29f05b62fc73f1218e0e6db6969481a3cd (diff)
fetch: centralize logic to print remote URL
When fetching from a remote, we not only print the actual references that have changed, but will also print the URL from which we have fetched them to standard output. The logic to handle this is duplicated across two different callsites with some non-trivial logic to compute the anonymized URL. Furthermore, we're using global state to track whether we have already shown the URL to the user or not. Refactor the code by moving it into `format_display()`. Like this, we can convert the global variable into a member of `display_state`. And second, we can deduplicate the logic to compute the anonymized URL. This also works as expected when fetching from multiple remotes, for example via a group of remotes, as we do this by forking a standalone git-fetch(1) process per remote that is to be fetched. 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