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:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-09-20 00:01:38 +0300
committerJunio C Hamano <gitster@pobox.com>2018-09-20 22:25:05 +0300
commit6b89a34c89fc763292f06012318b852b74825619 (patch)
tree3cdafdcd2fe60a89e6affa786221d507a39ef574 /t/t6500-gc.sh
parent1f7f557fd3eca251b1b14fa8240e1a12597c8730 (diff)
gc: fix regression in 7b0f229222 impacting --quiet
Fix a regression in my recent 7b0f229222 ("commit-graph write: add progress output", 2018-09-17). The newly added progress output for "commit-graph write" didn't check the --quiet option. Do so, and add a test asserting that this works as expected. Since the TTY prequisite isn't available everywhere let's add a version of this that both requires and doesn't require that. This test might be overly specific and will break if new progress output is added, but I think it'll serve as a good reminder to test the undertested progress mode(s). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Helped-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6500-gc.sh')
-rwxr-xr-xt/t6500-gc.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 818435f04e..b3fbd87ee7 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -4,6 +4,7 @@ test_description='basic git gc tests
'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-terminal.sh
test_expect_success 'setup' '
# do not let the amount of physical memory affects gc
@@ -99,6 +100,26 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre
test_line_count = 2 new # There is one new pack and its .idx
'
+test_expect_success 'gc --no-quiet' '
+ git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
+ test_must_be_empty stdout &&
+ test_line_count = 1 stderr &&
+ test_i18ngrep "Computing commit graph generation numbers" stderr
+'
+
+test_expect_success TTY 'with TTY: gc --no-quiet' '
+ test_terminal git -c gc.writeCommitGraph=true gc --no-quiet >stdout 2>stderr &&
+ test_must_be_empty stdout &&
+ test_i18ngrep "Enumerating objects" stderr &&
+ test_i18ngrep "Computing commit graph generation numbers" stderr
+'
+
+test_expect_success 'gc --quiet' '
+ git -c gc.writeCommitGraph=true gc --quiet >stdout 2>stderr &&
+ test_must_be_empty stdout &&
+ test_must_be_empty stderr
+'
+
run_and_wait_for_auto_gc () {
# We read stdout from gc for the side effect of waiting until the
# background gc process exits, closing its fd 9. Furthermore, the