Skip to content

Commit 94221d2

Browse files
peffgitster
authored andcommitted
t: use perl instead of "$PERL_PATH" where applicable
As of the last commit, we can use "perl" instead of "$PERL_PATH" when running tests, as the former is now a function which uses the latter. As the shorter "perl" is easier on the eyes, let's switch to using it everywhere. This is not quite a mechanical s/$PERL_PATH/perl/ replacement, though. There are some places where we invoke perl from a script we generate on the fly, and those scripts do not have access to our internal shell functions. The result can be double-checked by running: ln -s /bin/false bin-wrappers/perl make test which continues to pass even after this patch. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0e0ec9 commit 94221d2

28 files changed

+50
-50
lines changed

t/gitweb-lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ gitweb_run () {
6969
# written to web server logs, so we are not interested in that:
7070
# we are interested only in properly formatted errors/warnings
7171
rm -f gitweb.log &&
72-
"$PERL_PATH" -- "$SCRIPT_NAME" \
72+
perl -- "$SCRIPT_NAME" \
7373
>gitweb.output 2>gitweb.log &&
7474
perl -w -e '
7575
open O, ">gitweb.headers";

t/lib-git-svn.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export svnrepo
2929
svnconf=$PWD/svnconf
3030
export svnconf
3131

32-
"$PERL_PATH" -w -e "
32+
perl -w -e "
3333
use SVN::Core;
3434
use SVN::Repos;
3535
\$SVN::Core::VERSION gt '1.1.0' or exit(42);
@@ -146,7 +146,7 @@ stop_httpd () {
146146
}
147147

148148
convert_to_rev_db () {
149-
"$PERL_PATH" -w -- - "$@" <<\EOF
149+
perl -w -- - "$@" <<\EOF
150150
use strict;
151151
@ARGV == 2 or die "usage: convert_to_rev_db <input> <output>";
152152
open my $wr, '+>', $ARGV[1] or die "$!: couldn't open: $ARGV[1]";

t/lib-terminal.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test_expect_success PERL 'set up terminal for tests' '
1919
then
2020
:
2121
elif
22-
"$PERL_PATH" "$TEST_DIRECTORY"/test-terminal.perl \
22+
perl "$TEST_DIRECTORY"/test-terminal.perl \
2323
sh -c "test -t 1 && test -t 2"
2424
then
2525
test_set_prereq TTY &&
@@ -29,7 +29,7 @@ test_expect_success PERL 'set up terminal for tests' '
2929
echo >&4 "test_terminal: need to declare TTY prerequisite"
3030
return 127
3131
fi
32-
"$PERL_PATH" "$TEST_DIRECTORY"/test-terminal.perl "$@"
32+
perl "$TEST_DIRECTORY"/test-terminal.perl "$@"
3333
}
3434
fi
3535
'

t/t0202-gettext-perl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if ! test_have_prereq PERL; then
1212
test_done
1313
fi
1414

15-
"$PERL_PATH" -MTest::More -e 0 2>/dev/null || {
15+
perl -MTest::More -e 0 2>/dev/null || {
1616
skip_all="Perl Test::More unavailable, skipping test"
1717
test_done
1818
}
@@ -22,6 +22,6 @@ test_external_has_tap=1
2222

2323
test_external_without_stderr \
2424
'Perl Git::I18N API' \
25-
"$PERL_PATH" "$TEST_DIRECTORY"/t0202/test.pl
25+
perl "$TEST_DIRECTORY"/t0202/test.pl
2626

2727
test_done

t/t1010-mktree.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ test_expect_success 'ls-tree piped to mktree (2)' '
4242
'
4343

4444
test_expect_success 'ls-tree output in wrong order given to mktree (1)' '
45-
"$PERL_PATH" -e "print reverse <>" <top |
45+
perl -e "print reverse <>" <top |
4646
git mktree >actual &&
4747
test_cmp tree actual
4848
'
4949

5050
test_expect_success 'ls-tree output in wrong order given to mktree (2)' '
51-
"$PERL_PATH" -e "print reverse <>" <top.withsub |
51+
perl -e "print reverse <>" <top.withsub |
5252
git mktree >actual &&
5353
test_cmp tree.withsub actual
5454
'

t/t3300-funny-names.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test_expect_success 'ls-files -z does not quote funny filename' '
6969
tabs ," (dq) and spaces
7070
EOF
7171
git ls-files -z >ls-files.z &&
72-
"$PERL_PATH" -pe "y/\000/\012/" <ls-files.z >current &&
72+
perl -pe "y/\000/\012/" <ls-files.z >current &&
7373
test_cmp expected current
7474
'
7575

@@ -106,7 +106,7 @@ test_expect_success 'diff-index -z does not quote funny filename' '
106106
tabs ," (dq) and spaces
107107
EOF
108108
git diff-index -z --name-status $t0 >diff-index.z &&
109-
"$PERL_PATH" -pe "y/\000/\012/" <diff-index.z >current &&
109+
perl -pe "y/\000/\012/" <diff-index.z >current &&
110110
test_cmp expected current
111111
'
112112

@@ -116,7 +116,7 @@ test_expect_success 'diff-tree -z does not quote funny filename' '
116116
tabs ," (dq) and spaces
117117
EOF
118118
git diff-tree -z --name-status $t0 $t1 >diff-tree.z &&
119-
"$PERL_PATH" -pe y/\\000/\\012/ <diff-tree.z >current &&
119+
perl -pe y/\\000/\\012/ <diff-tree.z >current &&
120120
test_cmp expected current
121121
'
122122

t/t4014-format-patch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ check_threading () {
293293
(git format-patch --stdout "$@"; echo $? > status.out) |
294294
# Prints everything between the Message-ID and In-Reply-To,
295295
# and replaces all Message-ID-lookalikes by a sequence number
296-
"$PERL_PATH" -ne '
296+
perl -ne '
297297
if (/^(message-id|references|in-reply-to)/i) {
298298
$printing = 1;
299299
} elsif (/^\S/) {

t/t4020-diff-external.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ test_expect_success 'no diff with -diff' '
177177
git diff | grep Binary
178178
'
179179

180-
echo NULZbetweenZwords | "$PERL_PATH" -pe 'y/Z/\000/' > file
180+
echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file
181181

182182
test_expect_success 'force diff with "diff"' '
183183
echo >.gitattributes "file diff" &&

t/t4029-diff-trailing-space.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test_expect_success \
2727
git config --bool diff.suppressBlankEmpty true &&
2828
git diff f > actual &&
2929
test_cmp exp actual &&
30-
"$PERL_PATH" -i.bak -p -e "s/^\$/ /" exp &&
30+
perl -i.bak -p -e "s/^\$/ /" exp &&
3131
git config --bool diff.suppressBlankEmpty false &&
3232
git diff f > actual &&
3333
test_cmp exp actual &&

t/t4103-apply-binary.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ test_expect_success 'setup' '
2323
git commit -m "Initial Version" 2>/dev/null &&
2424
2525
git checkout -b binary &&
26-
"$PERL_PATH" -pe "y/x/\000/" <file1 >file3 &&
26+
perl -pe "y/x/\000/" <file1 >file3 &&
2727
cat file3 >file4 &&
2828
git add file2 &&
29-
"$PERL_PATH" -pe "y/\000/v/" <file3 >file1 &&
29+
perl -pe "y/\000/v/" <file3 >file1 &&
3030
rm -f file2 &&
3131
git update-index --add --remove file1 file2 file3 file4 &&
3232
git commit -m "Second Version" &&

0 commit comments

Comments
 (0)