diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-08-23 12:44:02 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-25 12:07:52 -0700 |
commit | ab628588f80e8dd889b700515c41548c1a356dcc (patch) | |
tree | 5d0808dccd5db4848038b992cdb5667f7074e098 /commit.c | |
parent | c2a4b6d4ee4f7f52521c1c36d63744f1a3c08d50 (diff) | |
download | git-ab628588f80e8dd889b700515c41548c1a356dcc.tar.gz |
advice: move advice.graftFileDeprecated squashing to commit.[ch]
Move the squashing of the advice.graftFileDeprecated advice over to an
external variable in commit.[ch], allowing advice() to purely use the
new-style API of invoking advice() with an enum.
See 8821e90a09a (advice: don't pointlessly suggest
--convert-graft-file, 2018-11-27) for why quieting this advice was
needed. It's more straightforward to move this code to commit.[ch] and
use it builtin/replace.c, than to go through the indirection of
advice.[ch].
Because this was the last advice_config variable we can remove that
old facility from advice.c.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -25,6 +25,7 @@ static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **); int save_commit_buffer = 1; +int no_graft_file_deprecated_advice; const char *commit_type = "commit"; @@ -190,7 +191,8 @@ static int read_graft_file(struct repository *r, const char *graft_file) struct strbuf buf = STRBUF_INIT; if (!fp) return -1; - if (advice_graft_file_deprecated) + if (!no_graft_file_deprecated_advice && + advice_enabled(ADVICE_GRAFT_FILE_DEPRECATED)) advise(_("Support for <GIT_DIR>/info/grafts is deprecated\n" "and will be removed in a future Git version.\n" "\n" |