Skip to content

Commit 62089fb

Browse files
Awaryngitster
authored andcommitted
t9001-send-email: move script creation in a setup test
Move the creation of the scripts used in to-cmd and cc-cmd tests in a setup test to make them available for later tests. Signed-off-by: Remi Lespinet <[email protected]> Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7974889 commit 62089fb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

t/t9001-send-email.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,19 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email'
312312
)
313313
'
314314

315+
test_expect_success $PREREQ 'setup tocmd and cccmd scripts' '
316+
write_script tocmd-sed <<-\EOF &&
317+
sed -n -e "s/^tocmd--//p" "$1"
318+
EOF
319+
write_script cccmd-sed <<-\EOF
320+
sed -n -e "s/^cccmd--//p" "$1"
321+
EOF
322+
'
323+
315324
test_expect_success $PREREQ 'tocmd works' '
316325
clean_fake_sendmail &&
317326
cp $patches tocmd.patch &&
318327
echo [email protected] >>tocmd.patch &&
319-
write_script tocmd-sed <<-\EOF &&
320-
sed -n -e "s/^tocmd--//p" "$1"
321-
EOF
322328
git send-email \
323329
--from="Example <[email protected]>" \
324330
--to-cmd=./tocmd-sed \
@@ -332,9 +338,6 @@ test_expect_success $PREREQ 'cccmd works' '
332338
clean_fake_sendmail &&
333339
cp $patches cccmd.patch &&
334340
echo "cccmd-- [email protected]" >>cccmd.patch &&
335-
write_script cccmd-sed <<-\EOF &&
336-
sed -n -e "s/^cccmd--//p" "$1"
337-
EOF
338341
git send-email \
339342
--from="Example <[email protected]>" \
340343

0 commit comments

Comments
 (0)