diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2020-09-17 18:11:43 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-17 11:30:05 -0700 |
commit | 3ddaad0e06035a752c9010dcd5094b37262080fb (patch) | |
tree | 98d25f3096405ddac2685bf270ef0ff22f4208ff /t/t7900-maintenance.sh | |
parent | maintenance: create basic maintenance runner (diff) | |
download | tgif-3ddaad0e06035a752c9010dcd5094b37262080fb.tar.xz |
maintenance: add --quiet option
Maintenance activities are commonly used as steps in larger scripts.
Providing a '--quiet' option allows those scripts to be less noisy when
run on a terminal window. Turn this mode on by default when stderr is
not a terminal.
Pipe the option to the 'git gc' child process.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7900-maintenance.sh')
-rwxr-xr-x | t/t7900-maintenance.sh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index c2f0b1d0c0..5637053bf6 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -13,11 +13,16 @@ test_expect_success 'help text' ' test_i18ngrep "usage: git maintenance" err ' -test_expect_success 'run [--auto]' ' - GIT_TRACE2_EVENT="$(pwd)/run-no-auto.txt" git maintenance run && - GIT_TRACE2_EVENT="$(pwd)/run-auto.txt" git maintenance run --auto && - test_subcommand git gc <run-no-auto.txt && - test_subcommand git gc --auto <run-auto.txt +test_expect_success 'run [--auto|--quiet]' ' + GIT_TRACE2_EVENT="$(pwd)/run-no-auto.txt" \ + git maintenance run 2>/dev/null && + GIT_TRACE2_EVENT="$(pwd)/run-auto.txt" \ + git maintenance run --auto 2>/dev/null && + GIT_TRACE2_EVENT="$(pwd)/run-no-quiet.txt" \ + git maintenance run --no-quiet 2>/dev/null && + test_subcommand git gc --quiet <run-no-auto.txt && + test_subcommand git gc --auto --quiet <run-auto.txt && + test_subcommand git gc --no-quiet <run-no-quiet.txt ' test_done |