Skip to content

Commit d492abb

Browse files
vdyegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9396251 commit d492abb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
535535
refresh_index(&the_index, flags, NULL, NULL,
536536
_("Unstaged changes after reset:"));
537537
t_delta_in_ms = (getnanotime() - t_begin) / 1000000;
538-
if (advice_enabled(ADVICE_RESET_NO_REFRESH_WARNING) && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) {
538+
if (!quiet && advice_enabled(ADVICE_RESET_NO_REFRESH_WARNING) && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) {
539539
advise(_("It took %.2f seconds to refresh the index after reset. You can use\n"
540540
"'--no-refresh' to avoid this. Set the config setting reset.refresh to false\n"
541541
"to make this the default."), t_delta_in_ms / 1000.0);

0 commit comments

Comments
 (0)