Skip to content

Commit 1bd3750

Browse files
peffgitster
authored andcommitted
t4205: drop top-level &&-chaining
The test currently does something like: do_one() && do_two() && test_expect_success ... We generally avoid performing actions at the top-level of the script (outside of a test_expect block) for two reasons: 1. The test harness is not checking and reporting if they fail. 2. Their output is not handled correctly (not hidden by default, nor shown with "-v"). Using &&-chains seems like it should help with (1), but it doesn't. If either of the commands fails, we simply skip running the follow-on test entirely, and the test harness has no idea. We can fix this by pushing that setup into its own block. It _could_ go into the following test block, but since the result in this case is used by multiple tests, it's more clear to mark it explicitly as a distinct setup step. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e634160 commit 1bd3750

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t4205-log-pretty-formats.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,10 @@ test_expect_success 'ISO and ISO-strict date formats display the same values' '
504504
'
505505

506506
# get new digests (with no abbreviations)
507-
head1=$(git rev-parse --verify HEAD~0) &&
508-
head2=$(git rev-parse --verify HEAD~1) &&
507+
test_expect_success 'set up log decoration tests' '
508+
head1=$(git rev-parse --verify HEAD~0) &&
509+
head2=$(git rev-parse --verify HEAD~1)
510+
'
509511

510512
test_expect_success 'log decoration properly follows tag chain' '
511513
git tag -a tag1 -m tag1 &&

0 commit comments

Comments
 (0)