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.

This will be used in the next commit.

Signed-off-by: Remi Lespinet <remi.lespi...@ensimag.grenoble-inp.fr>
---
 t/t9001-send-email.sh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 7be14a4..e63fc83 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -312,13 +312,19 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit 
ident aborts send-email'
        )
 '
 
+test_expect_success $PREREQ 'setup tocmd and cccmd scripts' '
+       write_script tocmd-sed <<-\EOF &&
+       sed -n -e "s/^tocmd--//p" "$1"
+       EOF
+       write_script cccmd-sed <<-\EOF
+       sed -n -e "s/^cccmd--//p" "$1"
+       EOF
+'
+
 test_expect_success $PREREQ 'tocmd works' '
        clean_fake_sendmail &&
        cp $patches tocmd.patch &&
        echo tocmd--to...@example.com >>tocmd.patch &&
-       write_script tocmd-sed <<-\EOF &&
-       sed -n -e "s/^tocmd--//p" "$1"
-       EOF
        git send-email \
                --from="Example <nob...@example.com>" \
                --to-cmd=./tocmd-sed \
@@ -332,9 +338,6 @@ test_expect_success $PREREQ 'cccmd works' '
        clean_fake_sendmail &&
        cp $patches cccmd.patch &&
        echo "cccmd--  cc...@example.com" >>cccmd.patch &&
-       write_script cccmd-sed <<-\EOF &&
-       sed -n -e "s/^cccmd--//p" "$1"
-       EOF
        git send-email \
                --from="Example <nob...@example.com>" \
                --to=nob...@example.com \
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to