From 87d8d8c5d09b1ee52cdf472b53b370020a7cb41c Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Tue, 1 Jul 2025 18:12:15 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- refs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 60642bc24a..6b9c6d5764 100644 --- a/refs.h +++ b/refs.h @@ -436,7 +436,8 @@ static inline const char *has_glob_specials(const char *pattern) } void refs_warn_dangling_symrefs(struct ref_store *refs, FILE *fp, - const char *msg_fmt, const struct string_list *refnames); + const char *indent, int dry_run, + const struct string_list *refnames); /* * Flags for controlling behaviour of pack_refs() -- cgit v1.3