diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2021-08-23 12:44:00 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-25 12:07:52 -0700 |
commit | ed9bff0817d5a7500b50a39c1c35b44aa3e72578 (patch) | |
tree | 2fbf27448d1085ad518e03a6c2a6c7902d271a28 /sequencer.c | |
parent | advice: add enum variants for missing advice variables (diff) | |
download | tgif-ed9bff0817d5a7500b50a39c1c35b44aa3e72578.tar.xz |
advice: remove read uses of most global `advice_` variables
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 <mathstuf@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sequencer.c b/sequencer.c index 7f07cd00f3..ab63eede45 100644 --- a/sequencer.c +++ b/sequencer.c @@ -486,7 +486,7 @@ static int error_dirty_index(struct repository *repo, struct replay_opts *opts) error(_("your local changes would be overwritten by %s."), _(action_name(opts))); - if (advice_commit_before_merge) + if (advice_enabled(ADVICE_COMMIT_BEFORE_MERGE)) advise(_("commit your changes or stash them to proceed.")); return -1; } @@ -1293,7 +1293,7 @@ void print_commit_summary(struct repository *r, if (!committer_ident_sufficiently_given()) { strbuf_addstr(&format, "\n Committer: "); strbuf_addbuf_percentquote(&format, &committer_ident); - if (advice_implicit_identity) { + if (advice_enabled(ADVICE_IMPLICIT_IDENTITY)) { strbuf_addch(&format, '\n'); strbuf_addstr(&format, implicit_ident_advice()); } @@ -3041,7 +3041,7 @@ static int create_seq_dir(struct repository *r) } if (in_progress_error) { error("%s", in_progress_error); - if (advice_sequencer_in_use) + if (advice_enabled(ADVICE_SEQUENCER_IN_USE)) advise(in_progress_advice, advise_skip ? "--skip | " : ""); return -1; @@ -3245,7 +3245,7 @@ int sequencer_skip(struct repository *r, struct replay_opts *opts) give_advice: error(_("there is nothing to skip")); - if (advice_resolve_conflict) { + if (advice_enabled(ADVICE_RESOLVE_CONFLICT)) { advise(_("have you committed already?\n" "try \"git %s --continue\""), action == REPLAY_REVERT ? "revert" : "cherry-pick"); |