t: Replace 'perl' by $PERL_PATH
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 11 Jun 2012 19:01:53 +0000 (19:01 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Jun 2012 16:30:41 +0000 (09:30 -0700)
GIT-BUILD-OPTIONS defines PERL_PATH to be used in the test suite. Only a
few tests already actually use this variable when perl is needed. The
other test just call 'perl' and it might happen that the wrong perl
interpreter is used.

This becomes problematic on Windows, when the perl interpreter that is
compiled and installed on the Windows system is used, because this perl
interpreter might introduce some unexpected LF->CRLF conversions.

This patch makes sure that $PERL_PATH is used everywhere in the test suite
and that the correct perl interpreter is used.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
24 files changed:
t/t1010-mktree.sh
t/t3300-funny-names.sh
t/t4014-format-patch.sh
t/t4020-diff-external.sh
t/t4029-diff-trailing-space.sh
t/t4030-diff-textconv.sh
t/t4031-diff-rewrite-binary.sh
t/t4103-apply-binary.sh
t/t4116-apply-reverse.sh
t/t4200-rerere.sh
t/t5300-pack-object.sh
t/t5303-pack-corruption-resilience.sh
t/t5532-fetch-proxy.sh
t/t5551-http-fetch.sh
t/t6011-rev-list-with-bad-commit.sh
t/t6013-rev-list-reverse-parents.sh
t/t7508-status.sh
t/t8006-blame-textconv.sh
t/t9129-git-svn-i18n-commitencoding.sh
t/t9137-git-svn-dcommit-clobber-series.sh
t/t9300-fast-import.sh
t/t9350-fast-export.sh
t/t9810-git-p4-rcs.sh
t/test-lib-functions.sh

index b946f8768649dd76d8a175877c63d49244e00ffb..3535761154bde43bc54dc62acf5c74fe5279dd5d 100755 (executable)
@@ -42,13 +42,13 @@ test_expect_success 'ls-tree piped to mktree (2)' '
 '
 
 test_expect_success 'ls-tree output in wrong order given to mktree (1)' '
-       perl -e "print reverse <>" <top |
+       $PERL_PATH -e "print reverse <>" <top |
        git mktree >actual &&
        test_cmp tree actual
 '
 
 test_expect_success 'ls-tree output in wrong order given to mktree (2)' '
-       perl -e "print reverse <>" <top.withsub |
+       $PERL_PATH -e "print reverse <>" <top.withsub |
        git mktree >actual &&
        test_cmp tree.withsub actual
 '
index c53c9f65ebd2824d4a0d528b25d85e1e0b26f4df..f42adc4ad5be62ee663dc957febc51b2e7b1eab5 100755 (executable)
@@ -71,7 +71,7 @@ test_expect_success 'ls-files -z does not quote funny filename' '
        tabs    ," (dq) and spaces
        EOF
        git ls-files -z >ls-files.z &&
-       perl -pe "y/\000/\012/" <ls-files.z >current &&
+       $PERL_PATH -pe "y/\000/\012/" <ls-files.z >current &&
        test_cmp expected current
 '
 
@@ -108,7 +108,7 @@ test_expect_success 'diff-index -z does not quote funny filename' '
        tabs    ," (dq) and spaces
        EOF
        git diff-index -z --name-status $t0 >diff-index.z &&
-       perl -pe "y/\000/\012/" <diff-index.z >current &&
+       $PERL_PATH -pe "y/\000/\012/" <diff-index.z >current &&
        test_cmp expected current
 '
 
@@ -118,7 +118,7 @@ test_expect_success 'diff-tree -z does not quote funny filename' '
        tabs    ," (dq) and spaces
        EOF
        git diff-tree -z --name-status $t0 $t1 >diff-tree.z &&
-       perl -pe y/\\000/\\012/ <diff-tree.z >current &&
+       $PERL_PATH -pe y/\\000/\\012/ <diff-tree.z >current &&
        test_cmp expected current
 '
 
index b473b6d6ebbf75f77be99085c26b68781b7f5fc6..4c22c17a3346161e933cbd1e8b4303cc20fde095 100755 (executable)
@@ -243,7 +243,7 @@ check_threading () {
        (git format-patch --stdout "$@"; echo $? > status.out) |
        # Prints everything between the Message-ID and In-Reply-To,
        # and replaces all Message-ID-lookalikes by a sequence number
-       perl -ne '
+       $PERL_PATH -ne '
                if (/^(message-id|references|in-reply-to)/i) {
                        $printing = 1;
                } elsif (/^\S/) {
index 083f62d1d6bb6bfd908b0a03db1a47f80071ef91..3d9307b25e30aaa27ae20c52153a2eeb70fcede5 100755 (executable)
@@ -118,7 +118,7 @@ test_expect_success 'no diff with -diff' '
        git diff | grep Binary
 '
 
-echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file
+echo NULZbetweenZwords | $PERL_PATH -pe 'y/Z/\000/' > file
 
 test_expect_success 'force diff with "diff"' '
        echo >.gitattributes "file diff" &&
index 3ccc237a8d4443bfc8763fbb9cb51033f846b0e8..7f7f504ab90da5732c8a7f41f69c5538865bd89e 100755 (executable)
@@ -27,7 +27,7 @@ test_expect_success \
      git config --bool diff.suppressBlankEmpty true &&
      git diff f > actual &&
      test_cmp exp actual &&
-     perl -i.bak -p -e "s/^\$/ /" exp &&
+     $PERL_PATH -i.bak -p -e "s/^\$/ /" exp &&
      git config --bool diff.suppressBlankEmpty false &&
      git diff f > actual &&
      test_cmp exp actual &&
index d4ab4f2ccf9a1bbbc1e6af84df5f09c373f9f465..82e36ec9426954d99d9c3115aa14c5eb15a12d2b 100755 (executable)
@@ -21,7 +21,7 @@ EOF
 
 cat >hexdump <<'EOF'
 #!/bin/sh
-perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1"
+$PERL_PATH -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1"
 EOF
 chmod +x hexdump
 
index c8296fa4fc1fbfe2645554d4818ae586d1cc2a14..e8ee06e29cf2592e12aeb8043a671e28e335399b 100755 (executable)
@@ -60,7 +60,7 @@ test_expect_success 'diff --stat counts binary rewrite as 0 lines' '
 {
        echo "#!$SHELL_PATH"
        cat <<'EOF'
-perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1"
+$PERL_PATH -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1"
 EOF
 } >dump
 chmod +x dump
index dbbf56cba9f5108f79d767ad48f3092dc821a232..5b533cf939d4bf2a1c89c8262b44d6558aafda0c 100755 (executable)
@@ -25,10 +25,10 @@ test_expect_success 'setup' "
        git commit -m 'Initial Version' 2>/dev/null &&
 
        git checkout -b binary &&
-       perl -pe 'y/x/\000/' <file1 >file3 &&
+       $PERL_PATH -pe 'y/x/\000/' <file1 >file3 &&
        cat file3 >file4 &&
        git add file2 &&
-       perl -pe 'y/\000/v/' <file3 >file1 &&
+       $PERL_PATH -pe 'y/\000/v/' <file3 >file1 &&
        rm -f file2 &&
        git update-index --add --remove file1 file2 file3 file4 &&
        git commit -m 'Second Version' &&
index 2298ece8019d79ef718ef658bdac74493d265b92..7b0c02abad8e5f94d6e3708cc0dce974b96f40fa 100755 (executable)
@@ -12,14 +12,14 @@ test_description='git apply in reverse
 test_expect_success setup '
 
        for i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&
-       perl -pe "y/ijk/\\000\\001\\002/" <file1 >file2 &&
+       $PERL_PATH -pe "y/ijk/\\000\\001\\002/" <file1 >file2 &&
 
        git add file1 file2 &&
        git commit -m initial &&
        git tag initial &&
 
        for i in a b c g h i J K L m o n p q; do echo $i; done >file1 &&
-       perl -pe "y/mon/\\000\\001\\002/" <file1 >file2 &&
+       $PERL_PATH -pe "y/mon/\\000\\001\\002/" <file1 >file2 &&
 
        git commit -a -m second &&
        git tag second &&
index 36255d608a7af7d85f479986e302138401f25a8d..ec7622cbeff251acb68600dc746eb7c5912bb324 100755 (executable)
@@ -78,7 +78,7 @@ test_expect_success 'activate rerere, old style (conflicting merge)' '
        test_might_fail git config --unset rerere.enabled &&
        test_must_fail git merge first &&
 
-       sha1=$(perl -pe "s/     .*//" .git/MERGE_RR) &&
+       sha1=$($PERL_PATH -pe "s/       .*//" .git/MERGE_RR) &&
        rr=.git/rr-cache/$sha1 &&
        grep "^=======\$" $rr/preimage &&
        ! test -f $rr/postimage &&
@@ -91,7 +91,7 @@ test_expect_success 'rerere.enabled works, too' '
        git reset --hard &&
        test_must_fail git merge first &&
 
-       sha1=$(perl -pe "s/     .*//" .git/MERGE_RR) &&
+       sha1=$($PERL_PATH -pe "s/       .*//" .git/MERGE_RR) &&
        rr=.git/rr-cache/$sha1 &&
        grep ^=======$ $rr/preimage
 '
@@ -101,7 +101,7 @@ test_expect_success 'set up rr-cache' '
        git config rerere.enabled true &&
        git reset --hard &&
        test_must_fail git merge first &&
-       sha1=$(perl -pe "s/     .*//" .git/MERGE_RR) &&
+       sha1=$($PERL_PATH -pe "s/       .*//" .git/MERGE_RR) &&
        rr=.git/rr-cache/$sha1
 '
 
@@ -185,7 +185,7 @@ test_expect_success 'rerere updates postimage timestamp' '
 
 test_expect_success 'rerere clear' '
        rm $rr/postimage &&
-       echo "$sha1     a1" | perl -pe "y/\012/\000/" >.git/MERGE_RR &&
+       echo "$sha1     a1" | $PERL_PATH -pe "y/\012/\000/" >.git/MERGE_RR &&
        git rerere clear &&
        ! test -d $rr
 '
index d9d856b87b2a896d4f80a3e62e6d1925b680a680..a97bb74811c8d10b1da83918a8c7c5ac62cdeb42 100755 (executable)
@@ -13,9 +13,9 @@ TRASH=`pwd`
 test_expect_success \
     'setup' \
     'rm -f .git/index* &&
-     perl -e "print \"a\" x 4096;" > a &&
-     perl -e "print \"b\" x 4096;" > b &&
-     perl -e "print \"c\" x 4096;" > c &&
+     $PERL_PATH -e "print \"a\" x 4096;" > a &&
+     $PERL_PATH -e "print \"b\" x 4096;" > b &&
+     $PERL_PATH -e "print \"c\" x 4096;" > c &&
      test-genrandom "seed a" 2097152 > a_big &&
      test-genrandom "seed b" 2097152 > b_big &&
      git update-index --add a a_big b b_big c &&
@@ -129,7 +129,7 @@ test_expect_success \
 cd "$TRASH"
 
 test_expect_success 'compare delta flavors' '
-       perl -e '\''
+       $PERL_PATH -e '\''
                defined($_ = -s $_) or die for @ARGV;
                exit 1 if $ARGV[0] <= $ARGV[1];
        '\'' test-2-$packname_2.pack test-3-$packname_3.pack
index 5f6cd4f3332f600888c402d2f1b72ddc8840b8cf..ee4e1af6845d2fcb7bccb6af98fc05d86aa44ea1 100755 (executable)
@@ -98,7 +98,7 @@ test_expect_success \
     'create_new_pack &&
      git prune-packed &&
      chmod +w ${pack}.pack &&
-     perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
+     $PERL_PATH -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
      test_must_fail git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'
@@ -155,7 +155,7 @@ test_expect_success \
     'create_new_pack &&
      git prune-packed &&
      chmod +w ${pack}.pack &&
-     perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
+     $PERL_PATH -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
      git cat-file blob $blob_1 > /dev/null &&
      test_must_fail git cat-file blob $blob_2 > /dev/null &&
      test_must_fail git cat-file blob $blob_3 > /dev/null'
index 62f246004771090aac71f816cadb8b0ed7aa0cb5..6ef43782663b07fe9594851d67ca1e314beacd24 100755 (executable)
@@ -15,7 +15,7 @@ test_expect_success 'setup remote repo' '
 cat >proxy <<'EOF'
 #!/bin/sh
 echo >&2 "proxying for $*"
-cmd=`perl -e '
+cmd=`$PERL_PATH -e '
        read(STDIN, $buf, 4);
        my $n = hex($buf) - 4;
        read(STDIN, $buf, $n);
index be6094be774587314a5dd249403eaaa313afde70..0667a3b750239fce88b4e61fbc40d1e126b5f6ab 100755 (executable)
@@ -130,7 +130,7 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
        done | git fast-import --export-marks=marks &&
 
        # now assign tags to all the dangling commits we created above
-       tag=$(perl -e "print \"bla\" x 30") &&
+       tag=$($PERL_PATH -e "print \"bla\" x 30") &&
        sed -e "s/^:\(.\+\) \(.\+\)$/\2 refs\/tags\/$tag-\1/" <marks >>packed-refs
        )
 '
index e51eb41f4b9575d2b51d8d4d255ff5ab7a0889ad..b2c6125bcf149ad9d9f6fc6b34a85c6c8250a553 100755 (executable)
@@ -37,7 +37,7 @@ test_expect_success 'verify number of revisions' \
 
 test_expect_success 'corrupt second commit object' \
    '
-   perl -i.bak -pe "s/second commit/socond commit/" .git/objects/pack/*.pack &&
+   $PERL_PATH -i.bak -pe "s/second commit/socond commit/" .git/objects/pack/*.pack &&
    test_must_fail git fsck --full
    '
 
index 59fc2f06e0b5895af60b6eb4084fe7a38d3aa948..3178c14d20d79c175f9ac7b49614fb840b0a4d7b 100755 (executable)
@@ -25,7 +25,7 @@ test_expect_success 'set up --reverse example' '
 
 test_expect_success '--reverse --parents --full-history combines correctly' '
        git rev-list --parents --full-history master -- foo |
-               perl -e "print reverse <>" > expected &&
+               $PERL_PATH -e "print reverse <>" > expected &&
        git rev-list --reverse --parents --full-history master -- foo \
                > actual &&
        test_cmp actual expected
@@ -33,7 +33,7 @@ test_expect_success '--reverse --parents --full-history combines correctly' '
 
 test_expect_success '--boundary does too' '
        git rev-list --boundary --parents --full-history master ^root -- foo |
-               perl -e "print reverse <>" > expected &&
+               $PERL_PATH -e "print reverse <>" > expected &&
        git rev-list --boundary --reverse --parents --full-history \
                master ^root -- foo > actual &&
        test_cmp actual expected
index 28e184829c0f12d4060f0b793db8511259bef91e..5e9160f807c3325466624e0e43bd2788b0d4c69b 100755 (executable)
@@ -941,7 +941,7 @@ test_expect_success 'status -s submodule summary (clean submodule)' '
 
 test_expect_success 'status -z implies porcelain' '
        git status --porcelain |
-       perl -pe "s/\012/\000/g" >expect &&
+       $PERL_PATH -pe "s/\012/\000/g" >expect &&
        git status -z >output &&
        test_cmp expect output
 '
index c3c22f7764adc1542579dfddf1b47a687a93607a..06b8f8609305d31dd5235a41ea1cfd9ac743d756 100755 (executable)
@@ -10,7 +10,7 @@ find_blame() {
 cat >helper <<'EOF'
 #!/bin/sh
 grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; }
-perl -p -e 's/^bin: /converted: /' "$1"
+$PERL_PATH -p -e 's/^bin: /converted: /' "$1"
 EOF
 chmod +x helper
 
index 8cfdfe790f1e0bb7cd0ddb72a72a55073368ec60..c9c8d029533569caa0c88c2c08ed670083d8f6a6 100755 (executable)
@@ -29,7 +29,7 @@ fi
 compare_svn_head_with () {
        # extract just the log message and strip out committer info.
        # don't use --limit here since svn 1.1.x doesn't have it,
-       LC_ALL="$a_utf8_locale" svn log `git svn info --url` | perl -w -e '
+       LC_ALL="$a_utf8_locale" svn log `git svn info --url` | $PERL_PATH -w -e '
                use bytes;
                $/ = ("-"x72) . "\n";
                my @x = <STDIN>;
index d60da63f7aced3e13a411eee661509ae3790e68f..726875af73365cd7ea64ddc63fcf3fc70cdb9cd3 100755 (executable)
@@ -20,8 +20,8 @@ test_expect_success '(supposedly) non-conflicting change from SVN' '
        test x"`sed -n -e 61p < file`" = x61 &&
        svn_cmd co "$svnrepo" tmp &&
        (cd tmp &&
-               perl -i.bak -p -e "s/^58$/5588/" file &&
-               perl -i.bak -p -e "s/^61$/6611/" file &&
+               $PERL_PATH -i.bak -p -e "s/^58$/5588/" file &&
+               $PERL_PATH -i.bak -p -e "s/^61$/6611/" file &&
                poke file &&
                test x"`sed -n -e 58p < file`" = x5588 &&
                test x"`sed -n -e 61p < file`" = x6611 &&
@@ -40,8 +40,8 @@ test_expect_success 'some unrelated changes to git' "
 test_expect_success 'change file but in unrelated area' "
        test x\"\`sed -n -e 4p < file\`\" = x4 &&
        test x\"\`sed -n -e 7p < file\`\" = x7 &&
-       perl -i.bak -p -e 's/^4\$/4444/' file &&
-       perl -i.bak -p -e 's/^7\$/7777/' file &&
+       $PERL_PATH -i.bak -p -e 's/^4\$/4444/' file &&
+       $PERL_PATH -i.bak -p -e 's/^7\$/7777/' file &&
        test x\"\`sed -n -e 4p < file\`\" = x4444 &&
        test x\"\`sed -n -e 7p < file\`\" = x7777 &&
        git commit -m '4 => 4444, 7 => 7777' file &&
index 2aa1824a940aa955fab408995d2479e50bd42b96..007e5af5f469664c89d2006fdc55a5fa85946582 100755 (executable)
@@ -12,7 +12,7 @@ test_description='test git fast-import utility'
 # This could be written as "head -c $1", but IRIX "head" does not
 # support the -c option.
 head_c () {
-       perl -e '
+       $PERL_PATH -e '
                my $len = $ARGV[1];
                while ($len > 0) {
                        my $s;
index b00196bd238f538f78ce421979e725ce501e84e1..6b6dc20fa4360f526fea34e872bf767c1b6a4be9 100755 (executable)
@@ -424,7 +424,7 @@ test_expect_success 'fast-export quotes pathnames' '
                --cacheinfo 100644 $blob "path with \\backslash" \
                --cacheinfo 100644 $blob "path with space" &&
         git commit -m addition &&
-        git ls-files -z -s | perl -0pe "s{\\t}{$&subdir/}" >index &&
+        git ls-files -z -s | $PERL_PATH -0pe "s{\\t}{$&subdir/}" >index &&
         git read-tree --empty &&
         git update-index -z --index-info <index &&
         git commit -m rename &&
index d8d9ca46793a6c09a19beb350e2f18dd199eb2c4..ce38c10ac5a8b99a313c31bbbe8eaa406bf9c4c0 100755 (executable)
@@ -246,7 +246,7 @@ test_expect_success 'cope with rcs keyword expansion damage' '
                git config git-p4.attemptRCSCleanup true &&
                (cd ../cli && p4_append_to_file kwfile1.c) &&
                old_lines=$(wc -l <kwfile1.c) &&
-               perl -n -i -e "print unless m/Revision:/" kwfile1.c &&
+               $PERL_PATH -n -i -e "print unless m/Revision:/" kwfile1.c &&
                new_lines=$(wc -l <kwfile1.c) &&
                test $new_lines = $(($old_lines - 1)) &&
 
index 7b3b4bef3019d7fd81648073419506ac017bd2e5..fc0c0809905498c98fe0de3080b9972488ec2d55 100644 (file)
@@ -76,11 +76,11 @@ test_decode_color () {
 }
 
 nul_to_q () {
-       perl -pe 'y/\000/Q/'
+       $PERL_PATH -pe 'y/\000/Q/'
 }
 
 q_to_nul () {
-       perl -pe 'y/Q/\000/'
+       $PERL_PATH -pe 'y/Q/\000/'
 }
 
 q_to_cr () {