]> granicus.if.org Git - git/commitdiff
t3904-stash-patch: factor PERL prereq at the top of the file
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Thu, 16 Apr 2015 07:02:30 +0000 (09:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Apr 2015 21:14:11 +0000 (14:14 -0700)
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3904-stash-patch.sh

index 9a596831d6e40ed1305b2cad7fc032bddbbbbc40..0f8f47fabc0dae38cce5c5a6d875fae38d2ab731 100755 (executable)
@@ -3,7 +3,13 @@
 test_description='stash -p'
 . ./lib-patch-mode.sh
 
-test_expect_success PERL 'setup' '
+if ! test_have_prereq PERL
+then
+       skip_all='skipping stash -p tests, perl not available'
+       test_done
+fi
+
+test_expect_success 'setup' '
        mkdir dir &&
        echo parent > dir/foo &&
        echo dummy > bar &&
@@ -20,7 +26,7 @@ test_expect_success PERL 'setup' '
 
 # note: order of files with unstaged changes: HEAD bar dir/foo
 
-test_expect_success PERL 'saying "n" does nothing' '
+test_expect_success 'saying "n" does nothing' '
        set_state HEAD HEADfile_work HEADfile_index &&
        set_state dir/foo work index &&
        (echo n; echo n; echo n) | test_must_fail git stash save -p &&
@@ -29,7 +35,7 @@ test_expect_success PERL 'saying "n" does nothing' '
        verify_state dir/foo work index
 '
 
-test_expect_success PERL 'git stash -p' '
+test_expect_success 'git stash -p' '
        (echo y; echo n; echo y) | git stash save -p &&
        verify_state HEAD committed HEADfile_index &&
        verify_saved_state bar &&
@@ -41,7 +47,7 @@ test_expect_success PERL 'git stash -p' '
        verify_state dir/foo work head
 '
 
-test_expect_success PERL 'git stash -p --no-keep-index' '
+test_expect_success 'git stash -p --no-keep-index' '
        set_state HEAD HEADfile_work HEADfile_index &&
        set_state bar bar_work bar_index &&
        set_state dir/foo work index &&
@@ -56,7 +62,7 @@ test_expect_success PERL 'git stash -p --no-keep-index' '
        verify_state dir/foo work index
 '
 
-test_expect_success PERL 'git stash --no-keep-index -p' '
+test_expect_success 'git stash --no-keep-index -p' '
        set_state HEAD HEADfile_work HEADfile_index &&
        set_state bar bar_work bar_index &&
        set_state dir/foo work index &&
@@ -71,7 +77,7 @@ test_expect_success PERL 'git stash --no-keep-index -p' '
        verify_state dir/foo work index
 '
 
-test_expect_success PERL 'none of this moved HEAD' '
+test_expect_success 'none of this moved HEAD' '
        verify_saved_head
 '