aboutsummaryrefslogtreecommitdiffstats
path: root/refs.h
diff options
context:
space:
mode:
authorPhil Hord <phil.hord@gmail.com>2025-07-01 18:12:15 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-01 18:42:25 -0700
commit87d8d8c5d09b1ee52cdf472b53b370020a7cb41c (patch)
tree7bc2254498aff64b2452cb8cbf55c467e495ad93 /refs.h
parentrefs: remove old refs_warn_dangling_symref (diff)
downloadgit-87d8d8c5d09b1ee52cdf472b53b370020a7cb41c.tar.gz
git-87d8d8c5d09b1ee52cdf472b53b370020a7cb41c.zip
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>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h3
1 files changed, 2 insertions, 1 deletions
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()