From ed9bff0817d5a7500b50a39c1c35b44aa3e72578 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 23 Aug 2021 12:44:00 +0200 Subject: advice: remove read uses of most global `advice_` variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In c4a09cc9ccb (Merge branch 'hw/advise-ng', 2020-03-25), a new API for accessing advice variables was introduced and deprecated `advice_config` in favor of a new array, `advice_setting`. This patch ports all but two uses which read the status of the global `advice_` variables over to the new `advice_enabled` API. We'll deal with advice_add_embedded_repo and advice_graft_file_deprecated separately. Signed-off-by: Ben Boeckel Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- object-name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'object-name.c') diff --git a/object-name.c b/object-name.c index 3263c19457..fdff4601b2 100644 --- a/object-name.c +++ b/object-name.c @@ -806,7 +806,7 @@ static int get_oid_basic(struct repository *r, const char *str, int len, refs_found = repo_dwim_ref(r, str, len, &tmp_oid, &real_ref, 0); if (refs_found > 0) { warning(warn_msg, len, str); - if (advice_object_name_warning) + if (advice_enabled(ADVICE_OBJECT_NAME_WARNING)) fprintf(stderr, "%s\n", _(object_name_msg)); } free(real_ref); -- cgit v1.2.3