Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-09-17 21:11:43 +0300
committerJunio C Hamano <gitster@pobox.com>2020-09-17 21:30:05 +0300
commit3ddaad0e06035a752c9010dcd5094b37262080fb (patch)
tree98d25f3096405ddac2685bf270ef0ff22f4208ff /t/t7900-maintenance.sh
parent2057d75038541cd16debb1c55f3f897fd244965c (diff)
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-xt/t7900-maintenance.sh15
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