Skip to content

Commit

Permalink
Merge branch 'tb/t5318-cleanup'
Browse files Browse the repository at this point in the history
Code cleanup.

* tb/t5318-cleanup:
  t5318: test that '--stdin-commits' respects '--[no-]progress'
  t5318: use 'test_must_be_empty'
  • Loading branch information
gitster committed Jun 18, 2020
2 parents 0cd0afc + 94fbd91 commit abacefe
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions t/t5318-commit-graph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test_expect_success 'Add more commits' '
test_expect_success 'commit-graph write progress off for redirected stderr' '
cd "$TRASH_DIRECTORY/full" &&
git commit-graph write 2>err &&
test_line_count = 0 err
test_must_be_empty err
'

test_expect_success 'commit-graph write force progress on for stderr' '
Expand All @@ -159,13 +159,34 @@ test_expect_success 'commit-graph write force progress on for stderr' '
test_expect_success 'commit-graph write with the --no-progress option' '
cd "$TRASH_DIRECTORY/full" &&
git commit-graph write --no-progress 2>err &&
test_line_count = 0 err
test_must_be_empty err
'

test_expect_success 'commit-graph write --stdin-commits progress off for redirected stderr' '
cd "$TRASH_DIRECTORY/full" &&
git rev-parse commits/5 >in &&
git commit-graph write --stdin-commits <in 2>err &&
test_must_be_empty err
'

test_expect_success 'commit-graph write --stdin-commits force progress on for stderr' '
cd "$TRASH_DIRECTORY/full" &&
git rev-parse commits/5 >in &&
GIT_PROGRESS_DELAY=0 git commit-graph write --stdin-commits --progress <in 2>err &&
test_i18ngrep "Collecting commits from input" err
'

test_expect_success 'commit-graph write --stdin-commits with the --no-progress option' '
cd "$TRASH_DIRECTORY/full" &&
git rev-parse commits/5 >in &&
git commit-graph write --stdin-commits --no-progress <in 2>err &&
test_must_be_empty err
'

test_expect_success 'commit-graph verify progress off for redirected stderr' '
cd "$TRASH_DIRECTORY/full" &&
git commit-graph verify 2>err &&
test_line_count = 0 err
test_must_be_empty err
'

test_expect_success 'commit-graph verify force progress on for stderr' '
Expand All @@ -177,7 +198,7 @@ test_expect_success 'commit-graph verify force progress on for stderr' '
test_expect_success 'commit-graph verify with the --no-progress option' '
cd "$TRASH_DIRECTORY/full" &&
git commit-graph verify --no-progress 2>err &&
test_line_count = 0 err
test_must_be_empty err
'

# Current graph structure:
Expand Down

0 comments on commit abacefe

Please sign in to comment.