]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5319-multi-pack-index.sh
multi-pack-index: add [--[no-]progress] option.
[thirdparty/git.git] / t / t5319-multi-pack-index.sh
index c72ca0439993bb25b3d0e25fa2ce5d399b49a2b7..cd2f87be6afe241a35e7c3b20fac09d10908f633 100755 (executable)
@@ -147,6 +147,21 @@ test_expect_success 'write midx with two packs' '
 
 compare_results_with_midx "two packs"
 
+test_expect_success 'write progress off for redirected stderr' '
+       git multi-pack-index --object-dir=$objdir write 2>err &&
+       test_line_count = 0 err
+'
+
+test_expect_success 'write force progress on for stderr' '
+       git multi-pack-index --object-dir=$objdir --progress write 2>err &&
+       test_file_not_empty err
+'
+
+test_expect_success 'write with the --no-progress option' '
+       git multi-pack-index --object-dir=$objdir --no-progress write 2>err &&
+       test_line_count = 0 err
+'
+
 test_expect_success 'add more packs' '
        for j in $(test_seq 11 20)
        do
@@ -169,6 +184,21 @@ test_expect_success 'verify multi-pack-index success' '
        git multi-pack-index verify --object-dir=$objdir
 '
 
+test_expect_success 'verify progress off for redirected stderr' '
+       git multi-pack-index verify --object-dir=$objdir 2>err &&
+       test_line_count = 0 err
+'
+
+test_expect_success 'verify force progress on for stderr' '
+       git multi-pack-index verify --object-dir=$objdir --progress 2>err &&
+       test_file_not_empty err
+'
+
+test_expect_success 'verify with the --no-progress option' '
+       git multi-pack-index verify --object-dir=$objdir --no-progress 2>err &&
+       test_line_count = 0 err
+'
+
 # usage: corrupt_midx_and_verify <pos> <data> <objdir> <string>
 corrupt_midx_and_verify() {
        POS=$1 &&
@@ -284,6 +314,21 @@ test_expect_success 'git-fsck incorrect offset' '
                "git -c core.multipackindex=true fsck"
 '
 
+test_expect_success 'repack progress off for redirected stderr' '
+       git multi-pack-index --object-dir=$objdir repack 2>err &&
+       test_line_count = 0 err
+'
+
+test_expect_success 'repack force progress on for stderr' '
+       git multi-pack-index --object-dir=$objdir --progress repack 2>err &&
+       test_file_not_empty err
+'
+
+test_expect_success 'repack with the --no-progress option' '
+       git multi-pack-index --object-dir=$objdir --no-progress repack 2>err &&
+       test_line_count = 0 err
+'
+
 test_expect_success 'repack removes multi-pack-index' '
        test_path_is_file $objdir/pack/multi-pack-index &&
        GIT_TEST_MULTI_PACK_INDEX=0 git repack -adf &&
@@ -413,6 +458,30 @@ test_expect_success 'expire does not remove any packs' '
        )
 '
 
+test_expect_success 'expire progress off for redirected stderr' '
+       (
+               cd dup &&
+               git multi-pack-index expire 2>err &&
+               test_line_count = 0 err
+       )
+'
+
+test_expect_success 'expire force progress on for stderr' '
+       (
+               cd dup &&
+               git multi-pack-index --progress expire 2>err &&
+               test_file_not_empty err
+       )
+'
+
+test_expect_success 'expire with the --no-progress option' '
+       (
+               cd dup &&
+               git multi-pack-index --no-progress expire 2>err &&
+               test_line_count = 0 err
+       )
+'
+
 test_expect_success 'expire removes unreferenced packs' '
        (
                cd dup &&