@@ -52,10 +52,6 @@ static struct {
[ADVICE_PUSH_FETCH_FIRST] = { "pushFetchFirst", 1 },
[ADVICE_PUSH_NEEDS_FORCE] = { "pushNeedsForce", 1 },
[ADVICE_PUSH_REF_NEEDS_UPDATE] = { "pushRefNeedsUpdate", 1 },
-
- /* make this an alias for backward compatibility */
- [ADVICE_PUSH_UPDATE_REJECTED_ALIAS] = { "pushNonFastForward", 1 },
-
[ADVICE_PUSH_NON_FF_CURRENT] = { "pushNonFFCurrent", 1 },
[ADVICE_PUSH_NON_FF_MATCHING] = { "pushNonFFMatching", 1 },
[ADVICE_PUSH_UNQUALIFIED_REF_NAME] = { "pushUnqualifiedRefName", 1 },
@@ -116,13 +112,7 @@ void advise(const char *advice, ...)
int advice_enabled(enum advice_type type)
{
- switch(type) {
- case ADVICE_PUSH_UPDATE_REJECTED:
- return advice_setting[ADVICE_PUSH_UPDATE_REJECTED].enabled &&
- advice_setting[ADVICE_PUSH_UPDATE_REJECTED_ALIAS].enabled;
- default:
- return advice_setting[type].enabled;
- }
+ return advice_setting[type].enabled;
}
void advise_if_enabled(enum advice_type type, const char *advice, ...)
@@ -32,7 +32,6 @@ enum advice_type {
ADVICE_PUSH_NON_FF_CURRENT,
ADVICE_PUSH_NON_FF_MATCHING,
ADVICE_PUSH_UNQUALIFIED_REF_NAME,
- ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
ADVICE_PUSH_UPDATE_REJECTED,
ADVICE_PUSH_REF_NEEDS_UPDATE,
ADVICE_RESET_QUIET_WARNING,
@@ -983,7 +983,7 @@ sub mw_import_revids {
}
sub error_non_fast_forward {
- my $advice = run_git_quoted(["config", "--bool", "advice.pushNonFastForward"]);
+ my $advice = run_git_quoted(["config", "--bool", "advice.pushUpdateRejected"]);
chomp($advice);
if ($advice ne 'false') {
# Native git-push would show this after the summary.
The advice.pushNonFastForward variable has been primarily known as advice.pushUpdateRejected since 1184564eac8 (push: rename config variable for more general use, 2012-12-02). It's been long enough by far that we can declare this deprecation period over and remove it. The only downside for users is going to be that they'll potentially see a more verbose warning that they'll have to re-squash by changing their config, but that's hardly an undue burden. Doing this allows us to simplify the advice_enabled() function down to something truly trivial. Change the only in-tree user of this, it was added in fd47d7b94db (git-remote-mediawiki: obey advice.pushNonFastForward, 2011-09-27), and not renamed in 1184564eac8 along with the rest. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- advice.c | 12 +----------- advice.h | 1 - contrib/mw-to-git/git-remote-mediawiki.perl | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-)