Skip to content

Commit 94fbd91

Browse files
ttaylorrgitster
authored andcommitted
t5318: test that '--stdin-commits' respects '--[no-]progress'
The following lines were not covered in a recent line-coverage test against Git: builtin/commit-graph.c 5b6653e 244) progress = start_delayed_progress( 5b6653e 268) stop_progress(&progress); These statements are executed when both '--stdin-commits' and '--progress' are passed. Introduce a trio of tests that exercise various combinations of these options to ensure that these lines are covered. More importantly, this is exercising a (somewhat) previously-ignored feature of '--stdin-commits', which is that it respects '--progress'. Prior to 5b6653e (builtin/commit-graph.c: dereference tags in builtin, 2020-05-13), dereferencing input from '--stdin-commits' was done inside of commit-graph.c. Now that an additional progress meter may be generated from outside of commit-graph.c, add a corresponding test to make sure that it also respects '--[no]-progress'. The other location that generates progress meter output (from d335ce8 (commit-graph.c: show progress of finding reachable commits, 2020-05-13)) is already covered by any test that passes '--reachable'. Signed-off-by: Taylor Blau <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6334c5f commit 94fbd91

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t5318-commit-graph.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,27 @@ test_expect_success 'commit-graph write with the --no-progress option' '
155155
test_must_be_empty err
156156
'
157157

158+
test_expect_success 'commit-graph write --stdin-commits progress off for redirected stderr' '
159+
cd "$TRASH_DIRECTORY/full" &&
160+
git rev-parse commits/5 >in &&
161+
git commit-graph write --stdin-commits <in 2>err &&
162+
test_must_be_empty err
163+
'
164+
165+
test_expect_success 'commit-graph write --stdin-commits force progress on for stderr' '
166+
cd "$TRASH_DIRECTORY/full" &&
167+
git rev-parse commits/5 >in &&
168+
GIT_PROGRESS_DELAY=0 git commit-graph write --stdin-commits --progress <in 2>err &&
169+
test_i18ngrep "Collecting commits from input" err
170+
'
171+
172+
test_expect_success 'commit-graph write --stdin-commits with the --no-progress option' '
173+
cd "$TRASH_DIRECTORY/full" &&
174+
git rev-parse commits/5 >in &&
175+
git commit-graph write --stdin-commits --no-progress <in 2>err &&
176+
test_must_be_empty err
177+
'
178+
158179
test_expect_success 'commit-graph verify progress off for redirected stderr' '
159180
cd "$TRASH_DIRECTORY/full" &&
160181
git commit-graph verify 2>err &&

0 commit comments

Comments
 (0)