diff options
author | Victoria Dye <vdye@github.com> | 2022-03-15 01:49:41 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-14 18:51:56 -0700 |
commit | d492abb0ae4a00c5647189b22f7c130fb364e700 (patch) | |
tree | 9f601a7d2861e7887b5fcca9a75d93b08e394179 /builtin/reset.c | |
parent | reset: replace '--quiet' with '--no-refresh' in performance advice (diff) | |
download | tgif-d492abb0ae4a00c5647189b22f7c130fb364e700.tar.xz |
reset: suppress '--no-refresh' advice if logging is silenced
If using '--quiet' or 'reset.quiet=true', do not print the 'resetnoRefresh'
advice string. For applications that rely on '--quiet' disabling all
non-error logs, the advice message should be suppressed accordingly.
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r-- | builtin/reset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index feab85e03d..c8a356ec5b 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -535,7 +535,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) refresh_index(&the_index, flags, NULL, NULL, _("Unstaged changes after reset:")); t_delta_in_ms = (getnanotime() - t_begin) / 1000000; - if (advice_enabled(ADVICE_RESET_NO_REFRESH_WARNING) && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) { + if (!quiet && advice_enabled(ADVICE_RESET_NO_REFRESH_WARNING) && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) { advise(_("It took %.2f seconds to refresh the index after reset. You can use\n" "'--no-refresh' to avoid this. Set the config setting reset.refresh to false\n" "to make this the default."), t_delta_in_ms / 1000.0); |