Skip to content

Commit 798a5b0

Browse files
moygitster
authored andcommitted
t3904-stash-patch: factor PERL prereq at the top of the file
Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 470b11e commit 798a5b0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

t/t3904-stash-patch.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
test_description='stash -p'
44
. ./lib-patch-mode.sh
55

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' '
713
mkdir dir &&
814
echo parent > dir/foo &&
915
echo dummy > bar &&
@@ -20,7 +26,7 @@ test_expect_success PERL 'setup' '
2026

2127
# note: order of files with unstaged changes: HEAD bar dir/foo
2228

23-
test_expect_success PERL 'saying "n" does nothing' '
29+
test_expect_success 'saying "n" does nothing' '
2430
set_state HEAD HEADfile_work HEADfile_index &&
2531
set_state dir/foo work index &&
2632
(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' '
2935
verify_state dir/foo work index
3036
'
3137

32-
test_expect_success PERL 'git stash -p' '
38+
test_expect_success 'git stash -p' '
3339
(echo y; echo n; echo y) | git stash save -p &&
3440
verify_state HEAD committed HEADfile_index &&
3541
verify_saved_state bar &&
@@ -41,7 +47,7 @@ test_expect_success PERL 'git stash -p' '
4147
verify_state dir/foo work head
4248
'
4349

44-
test_expect_success PERL 'git stash -p --no-keep-index' '
50+
test_expect_success 'git stash -p --no-keep-index' '
4551
set_state HEAD HEADfile_work HEADfile_index &&
4652
set_state bar bar_work bar_index &&
4753
set_state dir/foo work index &&
@@ -56,7 +62,7 @@ test_expect_success PERL 'git stash -p --no-keep-index' '
5662
verify_state dir/foo work index
5763
'
5864

59-
test_expect_success PERL 'git stash --no-keep-index -p' '
65+
test_expect_success 'git stash --no-keep-index -p' '
6066
set_state HEAD HEADfile_work HEADfile_index &&
6167
set_state bar bar_work bar_index &&
6268
set_state dir/foo work index &&
@@ -71,7 +77,7 @@ test_expect_success PERL 'git stash --no-keep-index -p' '
7177
verify_state dir/foo work index
7278
'
7379

74-
test_expect_success PERL 'none of this moved HEAD' '
80+
test_expect_success 'none of this moved HEAD' '
7581
verify_saved_head
7682
'
7783

0 commit comments

Comments
 (0)