]> git.ipfire.org Git - thirdparty/git.git/commit
clean up interface for refs_warn_dangling_symrefs
authorPhil Hord <phil.hord@gmail.com>
Wed, 2 Jul 2025 01:12:15 +0000 (18:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jul 2025 01:42:25 +0000 (18:42 -0700)
commit87d8d8c5d09b1ee52cdf472b53b370020a7cb41c
tree7bc2254498aff64b2452cb8cbf55c467e495ad93
parent0f846954999a332735c52dc26451be674ea617ba
clean up interface for refs_warn_dangling_symrefs

The refs_warn_dangling_symrefs interface is a bit fragile as it passes
in printf-formatting strings with expectations about the number of
arguments. This patch series made it worse by adding a 2nd positional
argument. But there are only two call sites, and they both use almost
identical display options.

Make this safer by moving the format strings into the function that uses
them to make it easier to see when the arguments don't match. Pass a
prefix string and a dry_run flag so the decision logic can be handled
where needed.

Signed-off-by: Phil Hord <phil.hord@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
builtin/remote.c
refs.c
refs.h