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 <remi.lespinet@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remi Lespinet committed Jun 30, 2015 at 14:16 UTC 62089fb8e9863b93cc7d9280ec39818dc28c23bf
1 file changed +9 -6
t/t9001-send-email.sh
+9 -6
@@ -312,13 +312,19 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email'
312 )
313 '
314
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 +
324 test_expect_success $PREREQ 'tocmd works' '
325 clean_fake_sendmail &&
326 cp $patches tocmd.patch &&
327 echo tocmd--tocmd@example.com >>tocmd.patch &&
319 - write_script tocmd-sed <<-\EOF &&
320 - sed -n -e "s/^tocmd--//p" "$1"
321 - EOF
328 git send-email \
329 --from="Example <nobody@example.com>" \
330 --to-cmd=./tocmd-sed \
@@ -332,9 +338,6 @@ test_expect_success $PREREQ 'cccmd works' '
338 clean_fake_sendmail &&
339 cp $patches cccmd.patch &&
340 echo "cccmd-- cccmd@example.com" >>cccmd.patch &&
335 - write_script cccmd-sed <<-\EOF &&
336 - sed -n -e "s/^cccmd--//p" "$1"
337 - EOF
341 git send-email \
342 --from="Example <nobody@example.com>" \
343 --to=nobody@example.com \