advice: remove read uses of most global advice_ variables

In c4a09cc9cc (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 <mathstuf@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ben Boeckel
2021-08-23 12:44:00 +02:00
committed by Junio C Hamano
parent 69290551b9
commit ed9bff0817
22 changed files with 50 additions and 137 deletions

View File

@ -271,7 +271,7 @@ void create_branch(struct repository *r,
real_ref = NULL;
if (get_oid_mb(start_name, &oid)) {
if (explicit_tracking) {
if (advice_set_upstream_failure) {
if (advice_enabled(ADVICE_SET_UPSTREAM_FAILURE)) {
error(_(upstream_missing), start_name);
advise(_(upstream_advice));
exit(1);