mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
0f84695499
commit
87d8d8c5d0
3
refs.h
3
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()
|
||||
|
||||
Reference in New Issue
Block a user