t3904-stash-patch: factor PERL prereq at the top of the file
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Apr 16, 2015 at 09:02 UTC
798a5b03fb89f6cb5d46db42beac02886223dfd3
1 file changed
+12
-6
t/t3904-stash-patch.sh
+12
-6
@@ -3,7 +3,13 @@
3
test_description='stash -p'
4
. ./lib-patch-mode.sh
5
6
-test_expect_success PERL 'setup' '
6
+if ! test_have_prereq PERL
7
+then
8
+ skip_all='skipping stash -p tests, perl not available'
9
+ test_done
10
+fi
11
+
12
+test_expect_success 'setup' '
13
mkdir dir &&
14
echo parent > dir/foo &&
15
echo dummy > bar &&
@@ -20,7 +26,7 @@ test_expect_success PERL 'setup' '
26
27
# note: order of files with unstaged changes: HEAD bar dir/foo
28
23
-test_expect_success PERL 'saying "n" does nothing' '
29
+test_expect_success 'saying "n" does nothing' '
30
set_state HEAD HEADfile_work HEADfile_index &&
31
set_state dir/foo work index &&
32
(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' '
35
verify_state dir/foo work index
36
'
37
32
-test_expect_success PERL 'git stash -p' '
38
+test_expect_success 'git stash -p' '
39
(echo y; echo n; echo y) | git stash save -p &&
40
verify_state HEAD committed HEADfile_index &&
41
verify_saved_state bar &&
@@ -41,7 +47,7 @@ test_expect_success PERL 'git stash -p' '
47
verify_state dir/foo work head
48
'
49
44
-test_expect_success PERL 'git stash -p --no-keep-index' '
50
+test_expect_success 'git stash -p --no-keep-index' '
51
set_state HEAD HEADfile_work HEADfile_index &&
52
set_state bar bar_work bar_index &&
53
set_state dir/foo work index &&
@@ -56,7 +62,7 @@ test_expect_success PERL 'git stash -p --no-keep-index' '
62
verify_state dir/foo work index
63
'
64
59
-test_expect_success PERL 'git stash --no-keep-index -p' '
65
+test_expect_success 'git stash --no-keep-index -p' '
66
set_state HEAD HEADfile_work HEADfile_index &&
67
set_state bar bar_work bar_index &&
68
set_state dir/foo work index &&
@@ -71,7 +77,7 @@ test_expect_success PERL 'git stash --no-keep-index -p' '
77
verify_state dir/foo work index
78
'
79
74
-test_expect_success PERL 'none of this moved HEAD' '
80
+test_expect_success 'none of this moved HEAD' '
81
verify_saved_head
82
'
83