Git fork

Merge branch 'ps/test-wo-perl-prereq' into ps/fewer-perl

* ps/test-wo-perl-prereq:
t5703: refactor test to not depend on Perl
t5316: refactor `max_chain()` to not depend on Perl
t0210: refactor trace2 scrubbing to not use Perl
t0021: refactor `generate_random_characters()` to not depend on Perl
t/lib-httpd: refactor "one-time-perl" CGI script to not depend on Perl
t/lib-t6000: refactor `name_from_description()` to not depend on Perl
t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl
t: refactor tests depending on Perl for textconv scripts
t: refactor tests depending on Perl to print data
t: refactor tests depending on Perl substitution operator
t: refactor tests depending on Perl transliteration operator
Makefile: stop requiring Perl when running tests
meson: stop requiring Perl when tests are enabled
t: adapt existing PERL prerequisites
t: introduce PERL_TEST_HELPERS prerequisite
t: adapt `test_readlink()` to not use Perl
t: adapt `test_copy_bytes()` to not use Perl
t: adapt character translation helpers to not use Perl
t: refactor environment sanitization to not use Perl
t: skip chain lint when PERL_PATH is unset

+471 -373
+1 -1
meson.build
··· 779 779 # features. It is optional if you want to neither execute tests nor use any of 780 780 # these optional features. 781 781 perl_required = get_option('perl') 782 - if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != [] 782 + if get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != [] 783 783 perl_required = true 784 784 endif 785 785
+13 -3
t/Makefile
··· 59 59 60 60 all:: $(DEFAULT_TEST_TARGET) 61 61 62 - test: pre-clean check-chainlint check-meson $(TEST_LINT) 62 + test: pre-clean check-meson $(TEST_LINT) 63 63 $(CHAINLINTSUPPRESS) $(MAKE) aggregate-results-and-cleanup 64 64 65 + ifneq ($(PERL_PATH),) 66 + test: check-chainlint 67 + prove: check-chainlint 68 + endif 69 + 65 70 failed: 66 71 @failed=$$(cd '$(TEST_RESULTS_DIRECTORY_SQ)' && \ 67 72 grep -l '^failed [1-9]' *.counts | \ 68 73 sed -n 's/\.counts$$/.sh/p') && \ 69 74 test -z "$$failed" || $(MAKE) $$failed 70 75 71 - prove: pre-clean check-chainlint $(TEST_LINT) 76 + prove: pre-clean $(TEST_LINT) 72 77 @echo "*** prove (shell & unit tests) ***" 73 78 @$(CHAINLINTSUPPRESS) TEST_OPTIONS='$(GIT_TEST_OPTS)' TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS) 74 79 $(MAKE) clean-except-prove-cache ··· 132 137 fi; \ 133 138 done 134 139 135 - test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \ 140 + test-lint: test-lint-duplicates test-lint-executable \ 136 141 test-lint-filenames 142 + ifneq ($(PERL_PATH),) 143 + test-lint: test-lint-shell-syntax 144 + else 145 + GIT_TEST_CHAIN_LINT = 0 146 + endif 137 147 ifneq ($(GIT_TEST_CHAIN_LINT),0) 138 148 test-lint: test-chainlint 139 149 endif
+13
t/helper/test-path-utils.c
··· 323 323 return 0; 324 324 } 325 325 326 + if (argc >= 2 && !strcmp(argv[1], "readlink")) { 327 + struct strbuf target = STRBUF_INIT; 328 + while (argc > 2) { 329 + if (strbuf_readlink(&target, argv[2], 0) < 0) 330 + die_errno("cannot read link at '%s'", argv[2]); 331 + puts(target.buf); 332 + argc--; 333 + argv++; 334 + } 335 + strbuf_release(&target); 336 + return 0; 337 + } 338 + 326 339 if (argc >= 2 && !strcmp(argv[1], "absolute_path")) { 327 340 while (argc > 2) { 328 341 puts(absolute_path(argv[2]));
+2 -2
t/helper/test-sha1.sh
··· 15 15 { 16 16 test -z "$pfx" || echo "$pfx" 17 17 dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null | 18 - perl -pe 'y/\000/g/' 18 + tr "\000" "g" 19 19 } | ./t/helper/test-tool $sha1 $cnt 20 20 ) 21 21 if test "$expect" = "$actual" ··· 61 61 { 62 62 test -z "$pfx" || echo "$pfx" 63 63 dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null | 64 - perl -pe 'y/\000/g/' 64 + tr "\000" "g" 65 65 } | sha1sum | 66 66 sed -e 's/ .*//' 67 67 )
+2 -2
t/lib-diff.sh
··· 21 21 # Also we do not check SHA1 hash generation in this test, which 22 22 # is a job for t0000-basic.sh 23 23 24 - perl -pe 'y/\000/\012/' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1 25 - perl -pe 'y/\000/\012/' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2 24 + tr "\000" "\012" <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1 25 + tr "\000" "\012" <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2 26 26 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 27 27 } 28 28
+1 -5
t/lib-gpg.sh
··· 192 192 ' 193 193 194 194 sanitize_pgp() { 195 - perl -ne ' 196 - /^-----END PGP/ and $in_pgp = 0; 197 - print unless $in_pgp; 198 - /^-----BEGIN PGP/ and $in_pgp = 1; 199 - ' 195 + sed "/^-----BEGIN PGP/,/^-----END PGP/{/^-/p;d;}" 200 196 }
+1 -1
t/lib-httpd.sh
··· 165 165 install_script broken-smart-http.sh 166 166 install_script error-smart-http.sh 167 167 install_script error.sh 168 - install_script apply-one-time-perl.sh 168 + install_script apply-one-time-script.sh 169 169 install_script nph-custom-auth.sh 170 170 171 171 ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
+3 -3
t/lib-httpd/apache.conf
··· 135 135 SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} 136 136 SetEnv GIT_HTTP_EXPORT_ALL 137 137 </LocationMatch> 138 - <LocationMatch /one_time_perl/> 138 + <LocationMatch /one_time_script/> 139 139 SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} 140 140 SetEnv GIT_HTTP_EXPORT_ALL 141 141 </LocationMatch> ··· 159 159 ScriptAlias /broken_smart/ broken-smart-http.sh/ 160 160 ScriptAlias /error_smart/ error-smart-http.sh/ 161 161 ScriptAlias /error/ error.sh/ 162 - ScriptAliasMatch /one_time_perl/(.*) apply-one-time-perl.sh/$1 162 + ScriptAliasMatch /one_time_script/(.*) apply-one-time-script.sh/$1 163 163 ScriptAliasMatch /custom_auth/(.*) nph-custom-auth.sh/$1 164 164 <Directory ${GIT_EXEC_PATH}> 165 165 Options FollowSymlinks ··· 182 182 <Files error.sh> 183 183 Options ExecCGI 184 184 </Files> 185 - <Files apply-one-time-perl.sh> 185 + <Files apply-one-time-script.sh> 186 186 Options ExecCGI 187 187 </Files> 188 188 <Files ${GIT_EXEC_PATH}/git-http-backend>
-27
t/lib-httpd/apply-one-time-perl.sh
··· 1 - #!/bin/sh 2 - 3 - # If "one-time-perl" exists in $HTTPD_ROOT_PATH, run perl on the HTTP response, 4 - # using the contents of "one-time-perl" as the perl command to be run. If the 5 - # response was modified as a result, delete "one-time-perl" so that subsequent 6 - # HTTP responses are no longer modified. 7 - # 8 - # This can be used to simulate the effects of the repository changing in 9 - # between HTTP request-response pairs. 10 - if test -f one-time-perl 11 - then 12 - LC_ALL=C 13 - export LC_ALL 14 - 15 - "$GIT_EXEC_PATH/git-http-backend" >out 16 - "$PERL_PATH" -pe "$(cat one-time-perl)" out >out_modified 17 - 18 - if cmp -s out out_modified 19 - then 20 - cat out 21 - else 22 - cat out_modified 23 - rm one-time-perl 24 - fi 25 - else 26 - "$GIT_EXEC_PATH/git-http-backend" 27 - fi
+26
t/lib-httpd/apply-one-time-script.sh
··· 1 + #!/bin/sh 2 + 3 + # If "one-time-script" exists in $HTTPD_ROOT_PATH, run the script on the HTTP 4 + # response. If the response was modified as a result, delete "one-time-script" 5 + # so that subsequent HTTP responses are no longer modified. 6 + # 7 + # This can be used to simulate the effects of the repository changing in 8 + # between HTTP request-response pairs. 9 + if test -f one-time-script 10 + then 11 + LC_ALL=C 12 + export LC_ALL 13 + 14 + "$GIT_EXEC_PATH/git-http-backend" >out 15 + ./one-time-script out >out_modified 16 + 17 + if cmp -s out out_modified 18 + then 19 + cat out 20 + else 21 + cat out_modified 22 + rm one-time-script 23 + fi 24 + else 25 + "$GIT_EXEC_PATH/git-http-backend" 26 + fi
+6 -7
t/lib-t6000.sh
··· 109 109 # All alphanums translated into -'s which are then compressed and stripped 110 110 # from front and back. 111 111 name_from_description () { 112 - perl -pe ' 113 - s/[^A-Za-z0-9.]/-/g; 114 - s/-+/-/g; 115 - s/-$//; 116 - s/^-//; 117 - y/A-Z/a-z/; 118 - ' 112 + sed \ 113 + -e 's/[^A-Za-z0-9.]/-/g' \ 114 + -e 's/--*/-/g' \ 115 + -e 's/-$//' \ 116 + -e 's/^-//' \ 117 + -e 'y/A-Z/a-z/' 119 118 } 120 119 121 120
+2 -2
t/t0008-ignores.sh
··· 39 39 } 40 40 41 41 broken_c_unquote () { 42 - "$PERL_PATH" -pe 's/^"//; s/\\//; s/"$//; tr/\n/\0/' "$@" 42 + sed -e 's/^"//' -e 's/\\//' -e 's/"$//' "$1" | tr '\n' '\0' 43 43 } 44 44 45 45 broken_c_unquote_verbose () { 46 - "$PERL_PATH" -pe 's/ "/ /; s/\\//; s/"$//; tr/:\t\n/\0/' "$@" 46 + sed -e 's/ "/ /' -e 's/\\//' -e 's/"$//' "$1" | tr ':\t\n' '\000' 47 47 } 48 48 49 49 stderr_contains () {
+6 -7
t/t0021-conversion.sh
··· 20 20 generate_random_characters () { 21 21 LEN=$1 22 22 NAME=$2 23 - test-tool genrandom some-seed $LEN | 24 - perl -pe "s/./chr((ord($&) % 26) + ord('a'))/sge" >"$TEST_ROOT/$NAME" 23 + test-tool genrandom some-seed | tr -dc 'a-z' | test_copy_bytes "$LEN" >"$TEST_ROOT/$NAME" 25 24 } 26 25 27 26 filter_git () { ··· 841 840 ) 842 841 ' 843 842 844 - test_expect_success PERL 'invalid process filter must fail (and not hang!)' ' 843 + test_expect_success 'invalid process filter must fail (and not hang!)' ' 845 844 test_config_global filter.protocol.process cat && 846 845 test_config_global filter.protocol.required true && 847 846 rm -rf repo && ··· 1111 1110 branch) opt='-f HEAD' ;; 1112 1111 esac 1113 1112 1114 - test_expect_success PERL,TTY "delayed checkout shows progress by default on tty ($mode checkout)" ' 1113 + test_expect_success TTY "delayed checkout shows progress by default on tty ($mode checkout)" ' 1115 1114 test_delayed_checkout_progress test_terminal git checkout $opt 1116 1115 ' 1117 1116 1118 - test_expect_success PERL "delayed checkout omits progress on non-tty ($mode checkout)" ' 1117 + test_expect_success "delayed checkout omits progress on non-tty ($mode checkout)" ' 1119 1118 test_delayed_checkout_progress ! git checkout $opt 1120 1119 ' 1121 1120 1122 - test_expect_success PERL,TTY "delayed checkout omits progress with --quiet ($mode checkout)" ' 1121 + test_expect_success TTY "delayed checkout omits progress with --quiet ($mode checkout)" ' 1123 1122 test_delayed_checkout_progress ! test_terminal git checkout --quiet $opt 1124 1123 ' 1125 1124 1126 - test_expect_success PERL,TTY "delayed checkout honors --[no]-progress ($mode checkout)" ' 1125 + test_expect_success TTY "delayed checkout honors --[no]-progress ($mode checkout)" ' 1127 1126 test_delayed_checkout_progress ! test_terminal git checkout --no-progress $opt && 1128 1127 test_delayed_checkout_progress test_terminal git checkout --quiet --progress $opt 1129 1128 '
+2 -2
t/t0090-cache-tree.sh
··· 128 128 test_cache_tree 129 129 ' 130 130 131 - test_expect_success PERL 'commit --interactive gives cache-tree on partial commit' ' 131 + test_expect_success 'commit --interactive gives cache-tree on partial commit' ' 132 132 test_when_finished "git reset --hard" && 133 133 cat <<-\EOT >foo.c && 134 134 int foo() ··· 162 162 test_cache_tree expected.status 163 163 ' 164 164 165 - test_expect_success PERL 'commit -p with shrinking cache-tree' ' 165 + test_expect_success 'commit -p with shrinking cache-tree' ' 166 166 mkdir -p deep/very-long-subdir && 167 167 echo content >deep/very-long-subdir/file && 168 168 git add deep &&
+43 -12
t/t0210-trace2-normal.sh
··· 53 53 # 54 54 # Implicit return from cmd_<verb> function propagates <code>. 55 55 56 + scrub_normal () { 57 + # Scrub the variable fields from the normal trace2 output to make 58 + # testing easier: 59 + # 60 + # 1. Various messages include an elapsed time in the middle of the 61 + # message. Replace the time with a placeholder to simplify our 62 + # HEREDOC in the test script. 63 + # 64 + # 2. We expect: 65 + # 66 + # start <argv0> [<argv1> [<argv2> [...]]] 67 + # 68 + # where argv0 might be a relative or absolute path, with or 69 + # without quotes, and platform dependent. Replace argv0 with a 70 + # token for HEREDOC matching in the test script. 71 + # 72 + # 3. Likewise, the 'cmd_path' message breaks out argv[0]. 73 + # 74 + # This line is only emitted when RUNTIME_PREFIX is defined, 75 + # so just omit it for testing purposes. 76 + # 77 + # 4. 'cmd_ancestry' is not implemented everywhere, so for portability's 78 + # sake, skip it when parsing normal. 79 + sed \ 80 + -e 's/elapsed:[0-9]*\.[0-9][0-9]*\([eE][-+]\{0,1\}[0-9][0-9]*\)\{0,1\}/elapsed:_TIME_/g' \ 81 + -e "s/^start '[^']*' \(.*\)/start _EXE_ \1/" \ 82 + -e 's/^start [^ ][^ ]* \(.*\)/start _EXE_ \1/' \ 83 + -e '/^cmd_path/d' \ 84 + -e '/^cmd_ancestry/d' 85 + } 86 + 56 87 test_expect_success 'normal stream, return code 0' ' 57 88 test_when_finished "rm trace.normal actual expect" && 58 89 GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 001return 0 && 59 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 90 + scrub_normal <trace.normal >actual && 60 91 cat >expect <<-EOF && 61 92 version $V 62 93 start _EXE_ trace2 001return 0 ··· 70 101 test_expect_success 'normal stream, return code 1' ' 71 102 test_when_finished "rm trace.normal actual expect" && 72 103 test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 001return 1 && 73 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 104 + scrub_normal <trace.normal >actual && 74 105 cat >expect <<-EOF && 75 106 version $V 76 107 start _EXE_ trace2 001return 1 ··· 85 116 test_when_finished "rm -r traces actual expect" && 86 117 mkdir traces && 87 118 GIT_TRACE2="$(pwd)/traces" test-tool trace2 001return 0 && 88 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <"$(ls traces/*)" >actual && 119 + scrub_normal <"$(ls traces/*)" >actual && 89 120 cat >expect <<-EOF && 90 121 version $V 91 122 start _EXE_ trace2 001return 0 ··· 103 134 test_expect_success 'normal stream, exit code 0' ' 104 135 test_when_finished "rm trace.normal actual expect" && 105 136 GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 002exit 0 && 106 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 137 + scrub_normal <trace.normal >actual && 107 138 cat >expect <<-EOF && 108 139 version $V 109 140 start _EXE_ trace2 002exit 0 ··· 117 148 test_expect_success 'normal stream, exit code 1' ' 118 149 test_when_finished "rm trace.normal actual expect" && 119 150 test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 002exit 1 && 120 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 151 + scrub_normal <trace.normal >actual && 121 152 cat >expect <<-EOF && 122 153 version $V 123 154 start _EXE_ trace2 002exit 1 ··· 135 166 test_expect_success 'normal stream, error event' ' 136 167 test_when_finished "rm trace.normal actual expect" && 137 168 GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 003error "hello world" "this is a test" && 138 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 169 + scrub_normal <trace.normal >actual && 139 170 cat >expect <<-EOF && 140 171 version $V 141 172 start _EXE_ trace2 003error '\''hello world'\'' '\''this is a test'\'' ··· 155 186 test_expect_success 'BUG messages are written to trace2' ' 156 187 test_when_finished "rm trace.normal actual expect" && 157 188 test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 007bug && 158 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 189 + scrub_normal <trace.normal >actual && 159 190 cat >expect <<-EOF && 160 191 version $V 161 192 start _EXE_ trace2 007bug ··· 179 210 sed "s/^.*: //" <err >actual && 180 211 test_cmp expect actual && 181 212 182 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 213 + scrub_normal <trace.normal >actual && 183 214 cat >expect <<-EOF && 184 215 version $V 185 216 start _EXE_ trace2 008bug ··· 205 236 sed "s/^.*: //" <err >actual && 206 237 test_cmp expect actual && 207 238 208 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 239 + scrub_normal <trace.normal >actual && 209 240 cat >expect <<-EOF && 210 241 version $V 211 242 start _EXE_ trace2 009bug_BUG ··· 230 261 sed "s/^.*: //" <err >actual && 231 262 test_cmp expect actual && 232 263 233 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 264 + scrub_normal <trace.normal >actual && 234 265 cat >expect <<-EOF && 235 266 version $V 236 267 start _EXE_ trace2 010bug_BUG ··· 262 293 test_config_global trace2.normalBrief 1 && 263 294 test_config_global trace2.normalTarget "$(pwd)/trace.normal" && 264 295 test-tool trace2 001return 0 && 265 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 296 + scrub_normal <trace.normal >actual && 266 297 cat >expect <<-EOF && 267 298 version $V 268 299 start _EXE_ trace2 001return 0 ··· 280 311 mv "$(pwd)/.gitconfig" "$(pwd)/real.gitconfig" && 281 312 test_config_global include.path "$(pwd)/real.gitconfig" && 282 313 test-tool trace2 001return 0 && 283 - perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual && 314 + scrub_normal <trace.normal >actual && 284 315 cat >expect <<-EOF && 285 316 version $V 286 317 start _EXE_ trace2 001return 0
-54
t/t0210/scrub_normal.perl
··· 1 - #!/usr/bin/perl 2 - # 3 - # Scrub the variable fields from the normal trace2 output to 4 - # make testing easier. 5 - 6 - use strict; 7 - use warnings; 8 - 9 - my $float = '[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?'; 10 - 11 - # This code assumes that the trace2 data was written with bare 12 - # turned on (which omits the "<clock> <file>:<line>" prefix. 13 - 14 - while (<>) { 15 - # Various messages include an elapsed time in the middle 16 - # of the message. Replace the time with a placeholder to 17 - # simplify our HEREDOC in the test script. 18 - s/elapsed:$float/elapsed:_TIME_/g; 19 - 20 - my $line = $_; 21 - 22 - # we expect: 23 - # start <argv0> [<argv1> [<argv2> [...]]] 24 - # 25 - # where argv0 might be a relative or absolute path, with 26 - # or without quotes, and platform dependent. Replace argv0 27 - # with a token for HEREDOC matching in the test script. 28 - 29 - if ($line =~ m/^start/) { 30 - $line =~ /^start\s+(.*)/; 31 - my $argv = $1; 32 - $argv =~ m/(\'[^\']*\'|[^ ]+)\s+(.*)/; 33 - my $argv_0 = $1; 34 - my $argv_rest = $2; 35 - 36 - print "start _EXE_ $argv_rest\n"; 37 - } 38 - elsif ($line =~ m/^cmd_path/) { 39 - # Likewise, the 'cmd_path' message breaks out argv[0]. 40 - # 41 - # This line is only emitted when RUNTIME_PREFIX is defined, 42 - # so just omit it for testing purposes. 43 - # print "cmd_path _EXE_\n"; 44 - } 45 - elsif ($line =~ m/^cmd_ancestry/) { 46 - # 'cmd_ancestry' is not implemented everywhere, so for portability's 47 - # sake, skip it when parsing normal. 48 - # 49 - # print "$line"; 50 - } 51 - else { 52 - print "$line"; 53 - } 54 - }
+6
t/t0211-trace2-perf.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 + if ! test_have_prereq PERL_TEST_HELPERS 8 + then 9 + skip_all='skipping trace2 tests; Perl not available' 10 + test_done 11 + fi 12 + 7 13 # Turn off any inherited trace2 settings for this test. 8 14 sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT 9 15 sane_unset GIT_TRACE2_PERF_BRIEF
+2 -3
t/t0610-reftable-basics.sh
··· 653 653 test_expect_success 'basic: can write large commit message' ' 654 654 test_when_finished "rm -rf repo" && 655 655 git init repo && 656 - perl -e " 657 - print \"this is a long commit message\" x 50000 658 - " >commit-msg && 656 + 657 + awk "BEGIN { for (i = 0; i < 50000; i++) printf \"%s\", \"this is a long commit message\" }" >commit-msg && 659 658 git -C repo commit --allow-empty --file=../commit-msg 660 659 ' 661 660
+1 -1
t/t0613-reftable-write-options.sh
··· 145 145 ( 146 146 cd repo && 147 147 test_commit A && 148 - perl -e "print \"a\" x 500" >logmsg && 148 + test-tool genzeros 500 | tr "\000" "a" >logmsg && 149 149 cat >expect <<-EOF && 150 150 fatal: update_ref failed for ref ${SQ}refs/heads/logme${SQ}: reftable: transaction failure: entry too large 151 151 EOF
+10 -6
t/t1006-cat-file.sh
··· 1270 1270 ' "$@" 1271 1271 } 1272 1272 1273 - test_expect_success 'cat-file --batch-all-objects --batch ignores replace' ' 1273 + test_expect_success PERL_TEST_HELPERS 'cat-file --batch-all-objects --batch ignores replace' ' 1274 1274 git cat-file --batch-all-objects --batch >actual.raw && 1275 1275 extract_batch_output $orig <actual.raw >actual && 1276 1276 { ··· 1323 1323 grep "^fatal:.*flush is only for --buffer mode.*" err 1324 1324 ' 1325 1325 1326 - script=' 1326 + perl_script=' 1327 1327 use warnings; 1328 1328 use strict; 1329 1329 use IPC::Open2; ··· 1345 1345 1346 1346 expect="$hello_oid blob $hello_size" 1347 1347 1348 - test_expect_success PERL '--batch-check is unbuffered by default' ' 1349 - perl -e "$script" -- --batch-check $hello_oid "$expect" 1348 + test_lazy_prereq PERL_IPC_OPEN2 ' 1349 + perl -MIPC::Open2 -e "exit 0" 1350 1350 ' 1351 1351 1352 - test_expect_success PERL '--batch-command info is unbuffered by default' ' 1353 - perl -e "$script" -- --batch-command $hello_oid "$expect" "info " 1352 + test_expect_success PERL_IPC_OPEN2 '--batch-check is unbuffered by default' ' 1353 + perl -e "$perl_script" -- --batch-check $hello_oid "$expect" 1354 + ' 1355 + 1356 + test_expect_success PERL_IPC_OPEN2 '--batch-command info is unbuffered by default' ' 1357 + perl -e "$perl_script" -- --batch-command $hello_oid "$expect" "info " 1354 1358 ' 1355 1359 1356 1360 test_done
+3 -3
t/t1007-hash-object.sh
··· 205 205 grep "too-short tree object" err 206 206 ' 207 207 208 - test_expect_success 'malformed mode in tree' ' 208 + test_expect_success PERL_TEST_HELPERS 'malformed mode in tree' ' 209 209 hex_oid=$(echo foo | git hash-object --stdin -w) && 210 210 bin_oid=$(echo $hex_oid | hex2oct) && 211 211 printf "9100644 \0$bin_oid" >tree-with-malformed-mode && ··· 213 213 grep "malformed mode in tree entry" err 214 214 ' 215 215 216 - test_expect_success 'empty filename in tree' ' 216 + test_expect_success PERL_TEST_HELPERS 'empty filename in tree' ' 217 217 hex_oid=$(echo foo | git hash-object --stdin -w) && 218 218 bin_oid=$(echo $hex_oid | hex2oct) && 219 219 printf "100644 \0$bin_oid" >tree-with-empty-filename && ··· 221 221 grep "empty filename in tree entry" err 222 222 ' 223 223 224 - test_expect_success 'duplicate filename in tree' ' 224 + test_expect_success PERL_TEST_HELPERS 'duplicate filename in tree' ' 225 225 hex_oid=$(echo foo | git hash-object --stdin -w) && 226 226 bin_oid=$(echo $hex_oid | hex2oct) && 227 227 {
+2 -2
t/t1010-mktree.sh
··· 42 42 ' 43 43 44 44 test_expect_success 'ls-tree output in wrong order given to mktree (1)' ' 45 - perl -e "print reverse <>" <top | 45 + sort -r <top | 46 46 git mktree >actual && 47 47 test_cmp tree actual 48 48 ' 49 49 50 50 test_expect_success 'ls-tree output in wrong order given to mktree (2)' ' 51 - perl -e "print reverse <>" <top.withsub | 51 + sort -r <top.withsub | 52 52 git mktree >actual && 53 53 test_cmp tree.withsub actual 54 54 '
+3 -3
t/t1450-fsck.sh
··· 346 346 test_grep ! "fatal: empty filename in tree entry" out 347 347 ' 348 348 349 - test_expect_success 'tree entry with type mismatch' ' 349 + test_expect_success PERL_TEST_HELPERS 'tree entry with type mismatch' ' 350 350 test_when_finished "remove_object \$blob" && 351 351 test_when_finished "remove_object \$tree" && 352 352 test_when_finished "remove_object \$commit" && ··· 364 364 test_grep ! "dangling blob" out 365 365 ' 366 366 367 - test_expect_success 'tree entry with bogus mode' ' 367 + test_expect_success PERL_TEST_HELPERS 'tree entry with bogus mode' ' 368 368 test_when_finished "remove_object \$blob" && 369 369 test_when_finished "remove_object \$tree" && 370 370 blob=$(echo blob | git hash-object -w --stdin) && ··· 984 984 985 985 # Corrupt the checksum on the index and then 986 986 # verify that only fsck notices. 987 - test_expect_success 'detect corrupt index file in fsck' ' 987 + test_expect_success PERL_TEST_HELPERS 'detect corrupt index file in fsck' ' 988 988 cp .git/index .git/index.backup && 989 989 test_when_finished "mv .git/index.backup .git/index" && 990 990 corrupt_index_checksum &&
+3 -3
t/t3300-funny-names.sh
··· 70 70 tabs ," (dq) and spaces 71 71 EOF 72 72 git ls-files -z >ls-files.z && 73 - perl -pe "y/\000/\012/" <ls-files.z >current && 73 + tr "\000" "\012" <ls-files.z >current && 74 74 test_cmp expected current 75 75 ' 76 76 ··· 107 107 tabs ," (dq) and spaces 108 108 EOF 109 109 git diff-index -z --name-status $t0 >diff-index.z && 110 - perl -pe "y/\000/\012/" <diff-index.z >current && 110 + tr "\000" "\012" <diff-index.z >current && 111 111 test_cmp expected current 112 112 ' 113 113 ··· 117 117 tabs ," (dq) and spaces 118 118 EOF 119 119 git diff-tree -z --name-status $t0 $t1 >diff-tree.z && 120 - perl -pe y/\\000/\\012/ <diff-tree.z >current && 120 + tr "\000" "\012" <diff-tree.z >current && 121 121 test_cmp expected current 122 122 ' 123 123
+6
t/t4013-diff-various.sh
··· 11 11 . ./test-lib.sh 12 12 . "$TEST_DIRECTORY"/lib-diff.sh 13 13 14 + if ! test_have_prereq PERL_TEST_HELPERS 15 + then 16 + skip_all='skipping diff various tests; Perl not available' 17 + test_done 18 + fi 19 + 14 20 test_expect_success setup ' 15 21 16 22 GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
+15 -15
t/t4014-format-patch.sh
··· 448 448 --- 449 449 EOF 450 450 451 - test_expect_success 'no threading' ' 451 + test_expect_success PERL_TEST_HELPERS 'no threading' ' 452 452 git checkout side && 453 453 check_threading expect.no-threading main 454 454 ' ··· 466 466 References: <0> 467 467 EOF 468 468 469 - test_expect_success 'thread' ' 469 + test_expect_success PERL_TEST_HELPERS 'thread' ' 470 470 check_threading expect.thread --thread main 471 471 ' 472 472 473 - test_expect_success '--thread overrides format.thread=deep' ' 473 + test_expect_success PERL_TEST_HELPERS '--thread overrides format.thread=deep' ' 474 474 test_config format.thread deep && 475 475 check_threading expect.thread --thread main 476 476 ' ··· 490 490 References: <1> 491 491 EOF 492 492 493 - test_expect_success 'thread in-reply-to' ' 493 + test_expect_success PERL_TEST_HELPERS 'thread in-reply-to' ' 494 494 check_threading expect.in-reply-to --in-reply-to="<test.message>" \ 495 495 --thread main 496 496 ' ··· 512 512 References: <0> 513 513 EOF 514 514 515 - test_expect_success 'thread cover-letter' ' 515 + test_expect_success PERL_TEST_HELPERS 'thread cover-letter' ' 516 516 check_threading expect.cover-letter --cover-letter --thread main 517 517 ' 518 518 ··· 538 538 <0> 539 539 EOF 540 540 541 - test_expect_success 'thread cover-letter in-reply-to' ' 541 + test_expect_success PERL_TEST_HELPERS 'thread cover-letter in-reply-to' ' 542 542 check_threading expect.cl-irt --cover-letter \ 543 543 --in-reply-to="<test.message>" --thread main 544 544 ' 545 545 546 - test_expect_success 'thread explicit shallow' ' 546 + test_expect_success PERL_TEST_HELPERS 'thread explicit shallow' ' 547 547 check_threading expect.cl-irt --cover-letter \ 548 548 --in-reply-to="<test.message>" --thread=shallow main 549 549 ' ··· 562 562 <1> 563 563 EOF 564 564 565 - test_expect_success 'thread deep' ' 565 + test_expect_success PERL_TEST_HELPERS 'thread deep' ' 566 566 check_threading expect.deep --thread=deep main 567 567 ' 568 568 ··· 584 584 <2> 585 585 EOF 586 586 587 - test_expect_success 'thread deep in-reply-to' ' 587 + test_expect_success PERL_TEST_HELPERS 'thread deep in-reply-to' ' 588 588 check_threading expect.deep-irt --thread=deep \ 589 589 --in-reply-to="<test.message>" main 590 590 ' ··· 609 609 <2> 610 610 EOF 611 611 612 - test_expect_success 'thread deep cover-letter' ' 612 + test_expect_success PERL_TEST_HELPERS 'thread deep cover-letter' ' 613 613 check_threading expect.deep-cl --cover-letter --thread=deep main 614 614 ' 615 615 ··· 638 638 <3> 639 639 EOF 640 640 641 - test_expect_success 'thread deep cover-letter in-reply-to' ' 641 + test_expect_success PERL_TEST_HELPERS 'thread deep cover-letter in-reply-to' ' 642 642 check_threading expect.deep-cl-irt --cover-letter \ 643 643 --in-reply-to="<test.message>" --thread=deep main 644 644 ' 645 645 646 - test_expect_success 'thread via config' ' 646 + test_expect_success PERL_TEST_HELPERS 'thread via config' ' 647 647 test_config format.thread true && 648 648 check_threading expect.thread main 649 649 ' 650 650 651 - test_expect_success 'thread deep via config' ' 651 + test_expect_success PERL_TEST_HELPERS 'thread deep via config' ' 652 652 test_config format.thread deep && 653 653 check_threading expect.deep main 654 654 ' 655 655 656 - test_expect_success 'thread config + override' ' 656 + test_expect_success PERL_TEST_HELPERS 'thread config + override' ' 657 657 test_config format.thread deep && 658 658 check_threading expect.thread --thread main 659 659 ' 660 660 661 - test_expect_success 'thread config + --no-thread' ' 661 + test_expect_success PERL_TEST_HELPERS 'thread config + --no-thread' ' 662 662 test_config format.thread deep && 663 663 check_threading expect.no-threading --no-thread main 664 664 '
+1 -1
t/t4020-diff-external.sh
··· 237 237 check_external_diff 1 empty empty 1 on --quiet 238 238 check_external_diff 128 empty error 2 on --quiet 239 239 240 - echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file 240 + echo NULZbetweenZwords | tr "Z" "\000" > file 241 241 242 242 test_expect_success 'force diff with "diff"' ' 243 243 after=$(git hash-object file) &&
+2 -1
t/t4029-diff-trailing-space.sh
··· 31 31 git config --bool diff.suppressBlankEmpty true && 32 32 git diff f > actual && 33 33 test_cmp exp actual && 34 - perl -i.bak -p -e "s/^\$/ /" exp && 34 + sed "s/^\$/ /" exp >exp.munged && 35 + mv exp.munged exp && 35 36 git config --bool diff.suppressBlankEmpty false && 36 37 git diff f > actual && 37 38 test_cmp exp actual &&
+3 -6
t/t4030-diff-textconv.sh
··· 20 20 +1 21 21 EOF 22 22 23 - cat >hexdump <<'EOF' 24 - #!/bin/sh 25 - "$PERL_PATH" -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1" 26 - EOF 27 - chmod +x hexdump 28 - 29 23 test_expect_success 'setup binary file with history' ' 24 + write_script hexdump <<-\EOF && 25 + tr "\000\001" "01" <"$1" 26 + EOF 30 27 test_commit --printf one file "\\0\\n" && 31 28 test_commit --printf --append two file "\\01\\n" 32 29 '
+6 -11
t/t4031-diff-rewrite-binary.sh
··· 57 57 grep " rewrite file" diff 58 58 ' 59 59 60 - { 61 - echo "#!$SHELL_PATH" 62 - cat <<'EOF' 63 - "$PERL_PATH" -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < "$1" 64 - EOF 65 - } >dump 66 - chmod +x dump 67 - 68 60 test_expect_success 'setup textconv' ' 61 + write_script dump <<-\EOF && 62 + test-tool hexdump <"$1" 63 + EOF 69 64 echo file diff=foo >.gitattributes && 70 65 git config diff.foo.textconv "\"$(pwd)\""/dump 71 66 ' 72 67 73 68 test_expect_success 'rewrite diff respects textconv' ' 74 69 git diff -B >diff && 75 - grep "dissimilarity index" diff && 76 - grep "^-61" diff && 77 - grep "^-0" diff 70 + test_grep "dissimilarity index" diff && 71 + test_grep "^-3d 0a 00" diff && 72 + test_grep "^+3d 0a 01" diff 78 73 ' 79 74 80 75 test_done
+6
t/t4058-diff-duplicates.sh
··· 13 13 14 14 . ./test-lib.sh 15 15 16 + if ! test_have_prereq PERL_TEST_HELPERS 17 + then 18 + skip_all='skipping diff duplicates tests; Perl not available' 19 + test_done 20 + fi 21 + 16 22 # make_tree_entry <mode> <mode> <sha1> 17 23 # 18 24 # We have to rely on perl here because not all printfs understand
+3 -3
t/t4103-apply-binary.sh
··· 26 26 git commit -m "Initial Version" 2>/dev/null && 27 27 28 28 git checkout -b binary && 29 - perl -pe "y/x/\000/" <file1 >file3 && 29 + tr "x" "\000" <file1 >file3 && 30 30 cat file3 >file4 && 31 31 git add file2 && 32 - perl -pe "y/\000/v/" <file3 >file1 && 32 + tr "y" "\000" <file3 >file1 && 33 33 rm -f file2 && 34 34 git update-index --add --remove file1 file2 file3 file4 && 35 35 git commit -m "Second Version" && ··· 158 158 test -z "$(git diff --name-status binary -- file3)" 159 159 ' 160 160 161 - test_expect_success 'reject truncated binary diff' ' 161 + test_expect_success PERL_TEST_HELPERS 'reject truncated binary diff' ' 162 162 do_reset && 163 163 164 164 # this length is calculated to get us very close to
+2 -2
t/t4116-apply-reverse.sh
··· 13 13 test_expect_success setup ' 14 14 15 15 test_write_lines a b c d e f g h i j k l m n >file1 && 16 - perl -pe "y/ijk/\\000\\001\\002/" <file1 >file2 && 16 + tr "ijk" "\000\001\002" <file1 >file2 && 17 17 18 18 git add file1 file2 && 19 19 git commit -m initial && 20 20 git tag initial && 21 21 22 22 test_write_lines a b c g h i J K L m o n p q >file1 && 23 - perl -pe "y/mon/\\000\\001\\002/" <file1 >file2 && 23 + tr "mon" "\000\001\002" <file1 >file2 && 24 24 25 25 git commit -a -m second && 26 26 git tag second &&
+4 -4
t/t4150-am.sh
··· 1084 1084 Body test" --author="$LONG <long@example.com>" && 1085 1085 git format-patch --stdout -1 >patch && 1086 1086 # bump from, date, and subject down to in-body header 1087 - perl -lpe " 1088 - if (/^From:/) { 1087 + awk " 1088 + /^From:/{ 1089 1089 print \"From: x <x\@example.com>\"; 1090 1090 print \"Date: Sat, 1 Jan 2000 00:00:00 +0000\"; 1091 1091 print \"Subject: x\n\"; 1092 - } 1093 - " patch >msg && 1092 + }; 1 1093 + " <patch >msg && 1094 1094 git checkout HEAD^ && 1095 1095 git am msg && 1096 1096 # Ensure that the author and full message are present
+4 -4
t/t4200-rerere.sh
··· 81 81 test_might_fail git config --unset rerere.enabled && 82 82 test_must_fail git merge first && 83 83 84 - sha1=$(perl -pe "s/ .*//" .git/MERGE_RR) && 84 + sha1=$(sed "s/ .*//" .git/MERGE_RR) && 85 85 rr=.git/rr-cache/$sha1 && 86 86 grep "^=======\$" $rr/preimage && 87 87 ! test -f $rr/postimage && ··· 94 94 git reset --hard && 95 95 test_must_fail git merge first && 96 96 97 - sha1=$(perl -pe "s/ .*//" .git/MERGE_RR) && 97 + sha1=$(sed "s/ .*//" .git/MERGE_RR) && 98 98 rr=.git/rr-cache/$sha1 && 99 99 grep ^=======$ $rr/preimage 100 100 ' ··· 104 104 git config rerere.enabled true && 105 105 git reset --hard && 106 106 test_must_fail git merge first && 107 - sha1=$(perl -pe "s/ .*//" .git/MERGE_RR) && 107 + sha1=$(sed "s/ .*//" .git/MERGE_RR) && 108 108 rr=.git/rr-cache/$sha1 109 109 ' 110 110 ··· 188 188 189 189 test_expect_success 'rerere clear' ' 190 190 mv $rr/postimage .git/post-saved && 191 - echo "$sha1 a1" | perl -pe "y/\012/\000/" >.git/MERGE_RR && 191 + echo "$sha1 a1" | tr "\012" "\000" >.git/MERGE_RR && 192 192 git rerere clear && 193 193 ! test -d $rr 194 194 '
+3 -3
t/t4205-log-pretty-formats.sh
··· 698 698 test_cmp expect actual 699 699 ' 700 700 701 - test_expect_success '%(trailers:unfold) unfolds trailers' ' 701 + test_expect_success PERL_TEST_HELPERS '%(trailers:unfold) unfolds trailers' ' 702 702 git log --no-walk --pretty="%(trailers:unfold)" >actual && 703 703 { 704 704 unfold <trailers && ··· 707 707 test_cmp expect actual 708 708 ' 709 709 710 - test_expect_success ':only and :unfold work together' ' 710 + test_expect_success PERL_TEST_HELPERS ':only and :unfold work together' ' 711 711 git log --no-walk --pretty="%(trailers:only,unfold)" >actual && 712 712 git log --no-walk --pretty="%(trailers:unfold,only)" >reverse && 713 713 test_cmp actual reverse && ··· 754 754 test_cmp expect actual 755 755 ' 756 756 757 - test_expect_success '%(trailers:key=foo,unfold) properly unfolds' ' 757 + test_expect_success PERL_TEST_HELPERS '%(trailers:key=foo,unfold) properly unfolds' ' 758 758 git log --no-walk --pretty="format:%(trailers:key=Signed-Off-by,unfold)" >actual && 759 759 unfold <trailers | grep Signed-off-by >expect && 760 760 test_cmp expect actual
+4 -4
t/t4216-log-bloom.sh
··· 738 738 test_cmp expect.out out 739 739 } 740 740 741 - test_expect_success 'Bloom reader notices too-small data chunk' ' 741 + test_expect_success PERL_TEST_HELPERS 'Bloom reader notices too-small data chunk' ' 742 742 check_corrupt_graph BDAT clear 00000000 && 743 743 echo "warning: ignoring too-small changed-path chunk" \ 744 744 "(4 < 12) in commit-graph file" >expect.err && 745 745 test_cmp expect.err err 746 746 ' 747 747 748 - test_expect_success 'Bloom reader notices out-of-bounds filter offsets' ' 748 + test_expect_success PERL_TEST_HELPERS 'Bloom reader notices out-of-bounds filter offsets' ' 749 749 check_corrupt_graph BIDX 12 FFFFFFFF && 750 750 # use grep to avoid depending on exact chunk size 751 751 grep "warning: ignoring out-of-range offset (4294967295) for changed-path filter at pos 3 of .git/objects/info/commit-graph" err 752 752 ' 753 753 754 - test_expect_success 'Bloom reader notices too-small index chunk' ' 754 + test_expect_success PERL_TEST_HELPERS 'Bloom reader notices too-small index chunk' ' 755 755 # replace the index with a single entry, making most 756 756 # lookups out-of-bounds 757 757 check_corrupt_graph BIDX clear 00000000 && ··· 760 760 test_cmp expect.err err 761 761 ' 762 762 763 - test_expect_success 'Bloom reader notices out-of-order index offsets' ' 763 + test_expect_success PERL_TEST_HELPERS 'Bloom reader notices out-of-order index offsets' ' 764 764 # we do not know any real offsets, but we can pick 765 765 # something plausible; we should not get to the point of 766 766 # actually reading from the bogus offsets anyway.
+6
t/t5004-archive-corner-cases.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 + if ! test_have_prereq PERL_TEST_HELPERS 8 + then 9 + skip_all='skipping archive corner cases tests; Perl not available' 10 + test_done 11 + fi 12 + 7 13 # the 10knuls.tar file is used to test for an empty git generated tar 8 14 # without having to invoke tar because an otherwise valid empty GNU tar 9 15 # will be considered broken by {Open,Net}BSD tar
+5 -5
t/t5300-pack-object.sh
··· 9 9 10 10 test_expect_success 'setup' ' 11 11 rm -f .git/index* && 12 - perl -e "print \"a\" x 4096;" >a && 13 - perl -e "print \"b\" x 4096;" >b && 14 - perl -e "print \"c\" x 4096;" >c && 12 + test-tool genzeros 4096 | tr "\000" "a" >a && 13 + test-tool genzeros 4096 | tr "\000" "b" >b && 14 + test-tool genzeros 4096 | tr "\000" "c" >c && 15 15 test-tool genrandom "seed a" 2097152 >a_big && 16 16 test-tool genrandom "seed b" 2097152 >b_big && 17 17 git update-index --add a a_big b b_big c && ··· 140 140 # usage: check_deltas <stderr_from_pack_objects> <cmp_op> <nr_deltas> 141 141 # e.g.: check_deltas stderr -gt 0 142 142 check_deltas() { 143 - deltas=$(perl -lne '/delta (\d+)/ and print $1' "$1") && 143 + deltas=$(sed -n 's/Total [0-9][0-9]* (delta \([0-9][0-9]*\)).*/\1/p' "$1") && 144 144 shift && 145 145 if ! test "$deltas" "$@" 146 146 then ··· 215 215 check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION" 216 216 ' 217 217 218 - test_expect_success 'compare delta flavors' ' 218 + test_expect_success PERL_TEST_HELPERS 'compare delta flavors' ' 219 219 perl -e '\'' 220 220 defined($_ = -s $_) or die for @ARGV; 221 221 exit 1 if $ARGV[0] <= $ARGV[1];
+4 -2
t/t5303-pack-corruption-resilience.sh
··· 103 103 create_new_pack && 104 104 git prune-packed && 105 105 chmod +w ${pack}.pack && 106 - perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack && 106 + sed "s/ base /abcdef/" ${pack}.pack >${pack}.pack.munged && 107 + mv ${pack}.pack.munged ${pack}.pack && 107 108 test_must_fail git cat-file blob $blob_1 > /dev/null && 108 109 test_must_fail git cat-file blob $blob_2 > /dev/null && 109 110 test_must_fail git cat-file blob $blob_3 > /dev/null ··· 160 161 create_new_pack && 161 162 git prune-packed && 162 163 chmod +w ${pack}.pack && 163 - perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack && 164 + sed "s/ delta1 /abcdefgh/" ${pack}.pack >${pack}.pack.munged && 165 + mv ${pack}.pack.munged ${pack}.pack && 164 166 git cat-file blob $blob_1 > /dev/null && 165 167 test_must_fail git cat-file blob $blob_2 > /dev/null && 166 168 test_must_fail git cat-file blob $blob_3 > /dev/null
+1 -1
t/t5310-pack-bitmaps.sh
··· 421 421 422 422 # mark the commits which did not receive bitmaps as preferred, 423 423 # and generate the bitmap again 424 - perl -pe "s{^}{create refs/tags/include/$. }" <before | 424 + sed "s|\(.*\)|create refs/tags/include/\1 \1|" before | 425 425 git update-ref --stdin && 426 426 git -c pack.preferBitmapTips=refs/tags/include repack -adb && 427 427
+5 -5
t/t5316-pack-delta-depth.sh
··· 76 76 77 77 max_chain() { 78 78 git index-pack --verify-stat-only "$1" >output && 79 - perl -lne ' 80 - BEGIN { $len = 0 } 81 - /chain length = (\d+)/ and $len = $1; 82 - END { print $len } 83 - ' output 79 + awk ' 80 + BEGIN { len=0 } 81 + /chain length = [0-9]+:/{ len=$4 } 82 + END { print len } 83 + ' <output | tr -d ':' 84 84 } 85 85 86 86 # Note that this whole setup is pretty reliant on the current
+6 -6
t/t5318-commit-graph.sh
··· 837 837 test_cmp expect.out out 838 838 } 839 839 840 - test_expect_success 'reader notices too-small oid fanout chunk' ' 840 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small oid fanout chunk' ' 841 841 # make it big enough that the graph file is plausible, 842 842 # otherwise we hit an earlier check 843 843 check_corrupt_chunk OIDF clear $(printf "000000%02x" $(test_seq 250)) && ··· 848 848 test_cmp expect.err err 849 849 ' 850 850 851 - test_expect_success 'reader notices fanout/lookup table mismatch' ' 851 + test_expect_success PERL_TEST_HELPERS 'reader notices fanout/lookup table mismatch' ' 852 852 check_corrupt_chunk OIDF 1020 "FFFFFFFF" && 853 853 cat >expect.err <<-\EOF && 854 854 error: commit-graph OID lookup chunk is the wrong size ··· 857 857 test_cmp expect.err err 858 858 ' 859 859 860 - test_expect_success 'reader notices out-of-bounds fanout' ' 860 + test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds fanout' ' 861 861 # Rather than try to corrupt a specific hash, we will just 862 862 # wreck them all. But we cannot just set them all to 0xFFFFFFFF or 863 863 # similar, as they are used for hi/lo starts in a binary search (so if ··· 873 873 test_cmp expect.err err 874 874 ' 875 875 876 - test_expect_success 'reader notices too-small commit data chunk' ' 876 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small commit data chunk' ' 877 877 check_corrupt_chunk CDAT clear 00000000 && 878 878 cat >expect.err <<-\EOF && 879 879 error: commit-graph commit data chunk is wrong size ··· 882 882 test_cmp expect.err err 883 883 ' 884 884 885 - test_expect_success 'reader notices out-of-bounds extra edge' ' 885 + test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds extra edge' ' 886 886 check_corrupt_chunk EDGE clear && 887 887 cat >expect.err <<-\EOF && 888 888 error: commit-graph extra-edges pointer out of bounds ··· 890 890 test_cmp expect.err err 891 891 ' 892 892 893 - test_expect_success 'reader notices too-small generations chunk' ' 893 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small generations chunk' ' 894 894 check_corrupt_chunk GDA2 clear 00000000 && 895 895 cat >expect.err <<-\EOF && 896 896 error: commit-graph generations chunk is wrong size
+8 -8
t/t5319-multi-pack-index.sh
··· 1120 1120 corrupt_chunk_file $midx "$@" 1121 1121 } 1122 1122 1123 - test_expect_success 'reader notices too-small oid fanout chunk' ' 1123 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small oid fanout chunk' ' 1124 1124 corrupt_chunk OIDF clear 00000000 && 1125 1125 test_must_fail git log 2>err && 1126 1126 cat >expect <<-\EOF && ··· 1130 1130 test_cmp expect err 1131 1131 ' 1132 1132 1133 - test_expect_success 'reader notices too-small oid lookup chunk' ' 1133 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small oid lookup chunk' ' 1134 1134 corrupt_chunk OIDL clear 00000000 && 1135 1135 test_must_fail git log 2>err && 1136 1136 cat >expect <<-\EOF && ··· 1140 1140 test_cmp expect err 1141 1141 ' 1142 1142 1143 - test_expect_success 'reader notices too-small pack names chunk' ' 1143 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small pack names chunk' ' 1144 1144 # There is no NUL to terminate the name here, so the 1145 1145 # chunk is too short. 1146 1146 corrupt_chunk PNAM clear 70656666 && ··· 1151 1151 test_cmp expect err 1152 1152 ' 1153 1153 1154 - test_expect_success 'reader handles unaligned chunks' ' 1154 + test_expect_success PERL_TEST_HELPERS 'reader handles unaligned chunks' ' 1155 1155 # A 9-byte PNAM means all of the subsequent chunks 1156 1156 # will no longer be 4-byte aligned, but it is still 1157 1157 # a valid one-pack chunk on its own (it is "foo.pack\0"). ··· 1165 1165 test_cmp expect.err err 1166 1166 ' 1167 1167 1168 - test_expect_success 'reader notices too-small object offset chunk' ' 1168 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small object offset chunk' ' 1169 1169 corrupt_chunk OOFF clear 00000000 && 1170 1170 test_must_fail git log 2>err && 1171 1171 cat >expect <<-\EOF && ··· 1175 1175 test_cmp expect err 1176 1176 ' 1177 1177 1178 - test_expect_success 'reader bounds-checks large offset table' ' 1178 + test_expect_success PERL_TEST_HELPERS 'reader bounds-checks large offset table' ' 1179 1179 # re-use the objects64 dir here to cheaply get access to a midx 1180 1180 # with large offsets. 1181 1181 git init repo && ··· 1197 1197 ) 1198 1198 ' 1199 1199 1200 - test_expect_success 'reader notices too-small revindex chunk' ' 1200 + test_expect_success PERL_TEST_HELPERS 'reader notices too-small revindex chunk' ' 1201 1201 # We only get a revindex with bitmaps (and likewise only 1202 1202 # load it when they are asked for). 1203 1203 test_config repack.writeBitmaps true && ··· 1214 1214 test_cmp expect.err err 1215 1215 ' 1216 1216 1217 - test_expect_success 'reader notices out-of-bounds fanout' ' 1217 + test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds fanout' ' 1218 1218 # This is similar to the out-of-bounds fanout test in t5318. The values 1219 1219 # in adjacent entries should be large but not identical (they 1220 1220 # are used as hi/lo starts for a binary search, which would then abort
+1 -1
t/t5324-split-commit-graph.sh
··· 401 401 ) 402 402 ' 403 403 404 - test_expect_success 'reader bounds-checks base-graph chunk' ' 404 + test_expect_success PERL_TEST_HELPERS 'reader bounds-checks base-graph chunk' ' 405 405 git clone --no-hardlinks . corrupt-base-chunk && 406 406 ( 407 407 cd corrupt-base-chunk &&
+2 -2
t/t5326-multi-pack-bitmaps.sh
··· 176 176 comm -13 bitmaps commits >before && 177 177 test_line_count = 1 before && 178 178 179 - perl -ne "printf(\"create refs/tags/include/%d \", $.); print" \ 180 - <before | git update-ref --stdin && 179 + sed "s|\(.*\)|create refs/tags/include/\1 \1|" before | 180 + git update-ref --stdin && 181 181 182 182 rm -fr $midx-$(midx_checksum $objdir).bitmap && 183 183 rm -fr $midx &&
+1 -1
t/t5328-commit-graph-64bit-time.sh
··· 74 74 git -C repo-uint32-max commit-graph verify 75 75 ' 76 76 77 - test_expect_success 'reader notices out-of-bounds generation overflow' ' 77 + test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds generation overflow' ' 78 78 graph=.git/objects/info/commit-graph && 79 79 test_when_finished "rm -rf $graph" && 80 80 git commit-graph write --reachable &&
+5 -7
t/t5333-pseudo-merge-bitmaps.sh
··· 28 28 29 29 tag_everything () { 30 30 git rev-list --all --no-object-names >in && 31 - perl -lne ' 32 - print "create refs/tags/" . $. . " " . $1 if /([0-9a-f]+)/ 33 - ' <in | git update-ref --stdin 31 + sed 's|\(.*\)|create refs/tags/\1 \1|' in | 32 + git update-ref --stdin 34 33 } 35 34 36 35 test_expect_success 'setup' ' ··· 102 101 test_cmp expect actual 103 102 ' 104 103 105 - test_expect_success 'bitmapPseudoMerge.sampleRate adjusts commit selection rate' ' 104 + test_expect_success PERL_TEST_HELPERS 'bitmapPseudoMerge.sampleRate adjusts commit selection rate' ' 106 105 test_config bitmapPseudoMerge.test.pattern "refs/tags/" && 107 106 test_config bitmapPseudoMerge.test.maxMerges 1 && 108 107 test_config bitmapPseudoMerge.test.stableThreshold never && ··· 235 234 test_commit_bulk 16 && 236 235 237 236 git rev-list HEAD~16.. >in && 238 - 239 - perl -lne "print \"create refs/remotes/$r/tags/\$. \$_\"" <in | 237 + sed "s|\(.*\)|create refs/remotes/$r/tags/\1 \1" in | 240 238 git update-ref --stdin || return 1 241 239 done && 242 240 ··· 252 250 do 253 251 test_pseudo_merge_commits $m >oids && 254 252 grep -f oids refs | 255 - perl -lne "print \$1 if /refs\/remotes\/([0-9]+)/" | 253 + sed -n "s|refs/remotes/\([0-9][0-9]*\)/|\1|p" && 256 254 sort -u || return 1 257 255 done >remotes && 258 256
+1 -1
t/t5400-send-pack.sh
··· 275 275 ' 276 276 } 277 277 278 - test_expect_success 'receive-pack de-dupes .have lines' ' 278 + test_expect_success PERL_TEST_HELPERS 'receive-pack de-dupes .have lines' ' 279 279 git init shared && 280 280 git -C shared commit --allow-empty -m both && 281 281 git clone -s shared fork &&
+1 -1
t/t5410-receive-pack-alternates.sh
··· 17 17 ' 18 18 19 19 extract_haves () { 20 - depacketize | perl -lne '/^(\S+) \.have/ and print $1' 20 + depacketize | sed -n 's/^\([^ ][^ ]*\) \.have/\1/p' 21 21 } 22 22 23 23 test_expect_success 'with core.alternateRefsCommand' '
+6
t/t5503-tagfollow.sh
··· 7 7 8 8 . ./test-lib.sh 9 9 10 + if ! test_have_prereq PERL_TEST_HELPERS 11 + then 12 + skip_all='skipping tagfollow tests; Perl not available' 13 + test_done 14 + fi 15 + 10 16 # End state of the repository: 11 17 # 12 18 # T - tag1 S - tag2
+1 -1
t/t5504-fetch-receive-strict.sh
··· 359 359 grep "Cannot demote unterminatedheader" act 360 360 ' 361 361 362 - test_expect_success 'badFilemode is not a strict error' ' 362 + test_expect_success PERL_TEST_HELPERS 'badFilemode is not a strict error' ' 363 363 git init --bare badmode.git && 364 364 tree=$( 365 365 cd badmode.git &&
+6
t/t5510-fetch.sh
··· 8 8 . ./test-lib.sh 9 9 . "$TEST_DIRECTORY"/lib-bundle.sh 10 10 11 + if ! test_have_prereq PERL_TEST_HELPERS 12 + then 13 + skip_all='skipping fetch tests; Perl not available' 14 + test_done 15 + fi 16 + 11 17 D=$(pwd) 12 18 13 19 test_expect_success setup '
+6
t/t5532-fetch-proxy.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 + if ! test_have_prereq PERL_TEST_HELPERS 8 + then 9 + skip_all='skipping fetch proxy tests; Perl not available' 10 + test_done 11 + fi 12 + 7 13 test_expect_success 'setup remote repo' ' 8 14 git init remote && 9 15 (cd remote &&
+1 -1
t/t5534-push-signed.sh
··· 205 205 # Tweak the push output to make the push option outside the cert 206 206 # different, then replay it on a fresh dst, checking that ff is not 207 207 # deleted. 208 - perl -pe "s/([^ ])bar/\$1baz/" push >push.tweak && 208 + sed "s/\([^ ]\)bar/\1baz/" push >push.tweak && 209 209 prepare_dst && 210 210 git -C dst config receive.certnonceseed sekrit && 211 211 git -C dst config receive.advertisepushoptions 1 &&
+7 -8
t/t5537-fetch-shallow.sh
··· 271 271 git -C "$REPO" config protocol.version 2 && 272 272 git -C client config protocol.version 2 && 273 273 274 - git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" main:a_branch && 274 + git -C client fetch --depth=2 "$HTTPD_URL/one_time_script/repo" main:a_branch && 275 275 276 276 # Craft a situation in which the server sends back an unshallow request 277 277 # with an empty packfile. This is done by refetching with a shorter 278 278 # depth (to ensure that the packfile is empty), and overwriting the 279 279 # shallow line in the response with the unshallow line we want. 280 - printf "$(test_oid perl)" \ 281 - "$(git -C "$REPO" rev-parse HEAD)" \ 282 - "$(git -C "$REPO" rev-parse HEAD^)" \ 283 - >"$HTTPD_ROOT_PATH/one-time-perl" && 280 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-EOF && 281 + sed "$(printf "$(test_oid perl)" "$(git -C "$REPO" rev-parse HEAD)" "$(git -C "$REPO" rev-parse HEAD^)")" "\$1" 282 + EOF 284 283 test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \ 285 - fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \ 284 + fetch --depth=1 "$HTTPD_URL/one_time_script/repo" \ 286 285 main:a_branch && 287 286 288 - # Ensure that the one-time-perl script was used. 289 - ! test -e "$HTTPD_ROOT_PATH/one-time-perl" && 287 + # Ensure that the one-time-script script was used. 288 + ! test -e "$HTTPD_ROOT_PATH/one-time-script" && 290 289 291 290 # Ensure that the resulting repo is consistent, despite our failure to 292 291 # fetch.
+7
t/t5551-http-fetch-smart.sh
··· 7 7 8 8 . ./test-lib.sh 9 9 . "$TEST_DIRECTORY"/lib-httpd.sh 10 + 11 + if ! test_have_prereq PERL_TEST_HELPERS 12 + then 13 + skip_all='skipping http fetch smart tests; Perl not available' 14 + test_done 15 + fi 16 + 10 17 test "$HTTP_PROTO" = "HTTP/2" && enable_http2 11 18 start_httpd 12 19
+6
t/t5562-http-backend-content-length.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 + if ! test_have_prereq PERL_TEST_HELPERS 8 + then 9 + skip_all='skipping http backend content tests; Perl not available' 10 + test_done 11 + fi 12 + 7 13 test_lazy_prereq GZIP 'gzip --version' 8 14 9 15 verify_http_result() {
+2 -2
t/t5601-clone.sh
··· 649 649 git -C replay.git index-pack -v --stdin <tmp.pack 650 650 ' 651 651 652 - test_expect_success 'clone on case-insensitive fs' ' 652 + test_expect_success PERL_TEST_HELPERS 'clone on case-insensitive fs' ' 653 653 git init icasefs && 654 654 ( 655 655 cd icasefs && ··· 662 662 ) 663 663 ' 664 664 665 - test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' ' 665 + test_expect_success PERL_TEST_HELPERS,CASE_INSENSITIVE_FS 'colliding file detection' ' 666 666 grep X icasefs/warning && 667 667 grep x icasefs/warning && 668 668 test_grep "the following paths have collided" icasefs/warning
+25 -21
t/t5616-partial-clone.sh
··· 737 737 sed 's/\(..\)/'$1'\1/g' 738 738 } 739 739 740 - # Create a one-time-perl command to replace the existing packfile with $1. 740 + # Create a one-time-script command to replace the existing packfile with $1. 741 741 replace_packfile () { 742 - # The protocol requires that the packfile be sent in sideband 1, hence 743 - # the extra \x01 byte at the beginning. 744 - cp $1 "$HTTPD_ROOT_PATH/one-time-pack" && 745 - echo 'if (/packfile/) { 746 - print; 747 - my $length = -s "one-time-pack"; 748 - printf "%04x\x01", $length + 5; 749 - print `cat one-time-pack` . "0000"; 750 - last 751 - }' >"$HTTPD_ROOT_PATH/one-time-perl" 742 + cp "$1" one-time-pack && 743 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-EOF 744 + if grep packfile "\$1" >/dev/null 745 + then 746 + sed '/packfile/q' "\$1" && 747 + # The protocol requires that the packfile be sent in sideband 748 + # 1, hence the extra \001 byte at the beginning. 749 + printf "%04x\001" \$((\$(wc -c <"$PWD/one-time-pack") + 5)) && 750 + cat "$PWD/one-time-pack" && 751 + printf "0000" 752 + else 753 + cat "\$1" 754 + fi 755 + EOF 752 756 } 753 757 754 758 test_expect_success 'upon cloning, check that all refs point to objects' ' ··· 776 780 # section header. 777 781 test_config -C "$SERVER" protocol.version 2 && 778 782 test_must_fail git -c protocol.version=2 clone \ 779 - --filter=blob:none $HTTPD_URL/one_time_perl/server repo 2>err && 783 + --filter=blob:none $HTTPD_URL/one_time_script/server repo 2>err && 780 784 781 785 test_grep "did not send all necessary objects" err && 782 786 783 - # Ensure that the one-time-perl script was used. 784 - ! test -e "$HTTPD_ROOT_PATH/one-time-perl" 787 + # Ensure that the one-time-script script was used. 788 + ! test -e "$HTTPD_ROOT_PATH/one-time-script" 785 789 ' 786 790 787 791 test_expect_success 'when partial cloning, tolerate server not sending target of tag' ' ··· 818 822 819 823 # Exercise to make sure it works. 820 824 git -c protocol.version=2 clone \ 821 - --filter=blob:none $HTTPD_URL/one_time_perl/server repo 2> err && 825 + --filter=blob:none $HTTPD_URL/one_time_script/server repo 2> err && 822 826 ! grep "missing object referenced by" err && 823 827 824 - # Ensure that the one-time-perl script was used. 825 - ! test -e "$HTTPD_ROOT_PATH/one-time-perl" 828 + # Ensure that the one-time-script script was used. 829 + ! test -e "$HTTPD_ROOT_PATH/one-time-script" 826 830 ' 827 831 828 - test_expect_success 'tolerate server sending REF_DELTA against missing promisor objects' ' 832 + test_expect_success PERL_TEST_HELPERS 'tolerate server sending REF_DELTA against missing promisor objects' ' 829 833 SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" && 830 834 rm -rf "$SERVER" repo && 831 835 test_create_repo "$SERVER" && ··· 845 849 846 850 # Clone. The client has deltabase_have but not deltabase_missing. 847 851 git -c protocol.version=2 clone --no-checkout \ 848 - --filter=blob:none $HTTPD_URL/one_time_perl/server repo && 852 + --filter=blob:none $HTTPD_URL/one_time_script/server repo && 849 853 git -C repo hash-object -w -- "$SERVER/have.txt" && 850 854 851 855 # Sanity check to ensure that the client does not have ··· 899 903 grep "want $(cat deltabase_missing)" trace && 900 904 ! grep "want $(cat deltabase_have)" trace && 901 905 902 - # Ensure that the one-time-perl script was used. 903 - ! test -e "$HTTPD_ROOT_PATH/one-time-perl" 906 + # Ensure that the one-time-script script was used. 907 + ! test -e "$HTTPD_ROOT_PATH/one-time-script" 904 908 ' 905 909 906 910 # DO NOT add non-httpd-specific tests here, because the last part of this
+4 -1
t/t5701-git-serve.sh
··· 228 228 echo command=ls-refs && 229 229 echo object-format=$(test_oid algo) && 230 230 echo 0001 && 231 - perl -le "print \"ref-prefix refs/heads/\$_\" for (1..65536)" && 231 + awk "{ 232 + for (i = 1; i <= 65536; i++) 233 + print \"ref-prefix refs/heads/\", \$i 234 + }" && 232 235 echo 0000 233 236 } | 234 237 test-tool pkt-line pack >in &&
+12 -9
t/t5702-protocol-v2.sh
··· 1174 1174 1175 1175 # After "ready" in the acknowledgments section, pretend that a FLUSH 1176 1176 # (0000) was sent instead of a DELIM (0001). 1177 - printf "\$ready = 1 if /ready/; \$ready && s/0001/0000/" \ 1178 - >"$HTTPD_ROOT_PATH/one-time-perl" && 1177 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-\EOF && 1178 + sed "/ready/{n;s/0001/0000/;}" "$1" 1179 + EOF 1179 1180 1180 1181 test_must_fail git -C http_child -c protocol.version=2 \ 1181 - fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err && 1182 + fetch "$HTTPD_URL/one_time_script/http_parent" 2> err && 1182 1183 test_grep "expected packfile to be sent after .ready." err 1183 1184 ' 1184 1185 ··· 1199 1200 1200 1201 # After the acknowledgments section, pretend that a DELIM 1201 1202 # (0001) was sent instead of a FLUSH (0000). 1202 - printf "\$ack = 1 if /acknowledgments/; \$ack && s/0000/0001/" \ 1203 - >"$HTTPD_ROOT_PATH/one-time-perl" && 1203 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-\EOF && 1204 + sed "/acknowledgments/,//{s/0000/0001/;}" "$1" 1205 + EOF 1204 1206 1205 1207 test_must_fail env GIT_TRACE_PACKET="$(pwd)/log" git -C http_child \ 1206 1208 -c protocol.version=2 \ 1207 - fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err && 1209 + fetch "$HTTPD_URL/one_time_script/http_parent" 2> err && 1208 1210 grep "fetch< .*acknowledgments" log && 1209 1211 ! grep "fetch< .*ready" log && 1210 1212 test_grep "expected no other sections to be sent after no .ready." err ··· 1490 1492 1491 1493 test_expect_success 'http:// --negotiate-only without wait-for-done support' ' 1492 1494 SERVER="server" && 1493 - URI="$HTTPD_URL/one_time_perl/server" && 1495 + URI="$HTTPD_URL/one_time_script/server" && 1494 1496 1495 1497 setup_negotiate_only "$SERVER" "$URI" && 1496 1498 1497 - echo "s/ wait-for-done/ xxxx-xxx-xxxx/" \ 1498 - >"$HTTPD_ROOT_PATH/one-time-perl" && 1499 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-\EOF && 1500 + sed "s/ wait-for-done/ xxxx-xxx-xxxx/" "$1" 1501 + EOF 1499 1502 1500 1503 test_must_fail git -c protocol.version=2 -C client fetch \ 1501 1504 --no-tags \
+15 -14
t/t5703-upload-pack-ref-in-want.sh
··· 83 83 84 84 test_expect_success 'config controls ref-in-want advertisement' ' 85 85 test-tool serve-v2 --advertise-capabilities >out && 86 - perl -ne "/ref-in-want/ and print" out >out.filter && 87 - test_must_be_empty out.filter && 86 + test_grep ! "ref-in-want" out && 88 87 89 88 git config uploadpack.allowRefInWant false && 90 89 test-tool serve-v2 --advertise-capabilities >out && 91 - perl -ne "/ref-in-want/ and print" out >out.filter && 92 - test_must_be_empty out.filter && 90 + test_grep ! "ref-in-want" out && 93 91 94 92 git config uploadpack.allowRefInWant true && 95 93 test-tool serve-v2 --advertise-capabilities >out && 96 - perl -ne "/ref-in-want/ and print" out >out.filter && 97 - test_file_not_empty out.filter 94 + test_grep "ref-in-want" out 98 95 ' 99 96 100 97 test_expect_success 'invalid want-ref line' ' ··· 462 459 test_commit m3 && 463 460 git tag -d m2 m3 464 461 ) && 465 - git -C "$LOCAL_PRISTINE" remote set-url origin "http://127.0.0.1:$LIB_HTTPD_PORT/one_time_perl/repo" && 462 + git -C "$LOCAL_PRISTINE" remote set-url origin "http://127.0.0.1:$LIB_HTTPD_PORT/one_time_script/repo" && 466 463 git -C "$LOCAL_PRISTINE" config protocol.version 2 467 464 ' 468 465 ··· 475 472 # RPCs during a single negotiation. 476 473 oid1=$(git -C "$REPO" rev-parse $1) && 477 474 oid2=$(git -C "$REPO" rev-parse $2) && 478 - echo "s/$oid1/$oid2/" >"$HTTPD_ROOT_PATH/one-time-perl" 475 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-EOF 476 + sed "s/$oid1/$oid2/" "\$1" 477 + EOF 479 478 } 480 479 481 - test_expect_success 'server is initially ahead - no ref in want' ' 480 + test_expect_success PERL_TEST_HELPERS 'server is initially ahead - no ref in want' ' 482 481 git -C "$REPO" config uploadpack.allowRefInWant false && 483 482 rm -rf local && 484 483 cp -r "$LOCAL_PRISTINE" local && ··· 487 486 test_grep "fatal: remote error: upload-pack: not our ref" err 488 487 ' 489 488 490 - test_expect_success 'server is initially ahead - ref in want' ' 489 + test_expect_success PERL_TEST_HELPERS 'server is initially ahead - ref in want' ' 491 490 git -C "$REPO" config uploadpack.allowRefInWant true && 492 491 rm -rf local && 493 492 cp -r "$LOCAL_PRISTINE" local && ··· 499 498 test_cmp expected actual 500 499 ' 501 500 502 - test_expect_success 'server is initially behind - no ref in want' ' 501 + test_expect_success PERL_TEST_HELPERS 'server is initially behind - no ref in want' ' 503 502 git -C "$REPO" config uploadpack.allowRefInWant false && 504 503 rm -rf local && 505 504 cp -r "$LOCAL_PRISTINE" local && ··· 511 510 test_cmp expected actual 512 511 ' 513 512 514 - test_expect_success 'server is initially behind - ref in want' ' 513 + test_expect_success PERL_TEST_HELPERS 'server is initially behind - ref in want' ' 515 514 git -C "$REPO" config uploadpack.allowRefInWant true && 516 515 rm -rf local && 517 516 cp -r "$LOCAL_PRISTINE" local && ··· 523 522 test_cmp expected actual 524 523 ' 525 524 526 - test_expect_success 'server loses a ref - ref in want' ' 525 + test_expect_success PERL_TEST_HELPERS 'server loses a ref - ref in want' ' 527 526 git -C "$REPO" config uploadpack.allowRefInWant true && 528 527 rm -rf local && 529 528 cp -r "$LOCAL_PRISTINE" local && 530 - echo "s/main/rain/" >"$HTTPD_ROOT_PATH/one-time-perl" && 529 + write_script "$HTTPD_ROOT_PATH/one-time-script" <<-\EOF && 530 + sed "s/main/rain/" "$1" 531 + EOF 531 532 test_must_fail git -C local fetch 2>err && 532 533 533 534 test_grep "fatal: remote error: unknown ref refs/heads/rain" err
+6
t/t5710-promisor-remote-capability.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 + if ! test_have_prereq PERL_TEST_HELPERS 8 + then 9 + skip_all='skipping promisor remote capabilities tests; Perl not available' 10 + test_done 11 + fi 12 + 7 13 GIT_TEST_MULTI_PACK_INDEX=0 8 14 GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL=0 9 15
+9 -5
t/t6011-rev-list-with-bad-commit.sh
··· 35 35 first_commit=$(git rev-parse HEAD~3) 36 36 ' 37 37 38 - test_expect_success 'corrupt second commit object' \ 39 - ' 40 - perl -i.bak -pe "s/second commit/socond commit/" .git/objects/pack/*.pack && 41 - test_must_fail git fsck --full 42 - ' 38 + test_expect_success 'corrupt second commit object' ' 39 + for p in .git/objects/pack/*.pack 40 + do 41 + sed "s/second commit/socond commit/" "$p" >"$p.munged" && 42 + mv "$p.munged" "$p" || 43 + return 1 44 + done && 45 + test_must_fail git fsck --full 46 + ' 43 47 44 48 test_expect_success 'rev-list should fail' ' 45 49 test_must_fail env GIT_TEST_COMMIT_GRAPH=0 git -c core.commitGraph=false rev-list --all > /dev/null
+6 -4
t/t6013-rev-list-reverse-parents.sh
··· 26 26 commit five 27 27 ' 28 28 29 + reverse () { 30 + awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' 31 + } 32 + 29 33 test_expect_success '--reverse --parents --full-history combines correctly' ' 30 - git rev-list --parents --full-history main -- foo | 31 - perl -e "print reverse <>" > expected && 34 + git rev-list --parents --full-history main -- foo | reverse >expected && 32 35 git rev-list --reverse --parents --full-history main -- foo \ 33 36 > actual && 34 37 test_cmp expected actual 35 38 ' 36 39 37 40 test_expect_success '--boundary does too' ' 38 - git rev-list --boundary --parents --full-history main ^root -- foo | 39 - perl -e "print reverse <>" > expected && 41 + git rev-list --boundary --parents --full-history main ^root -- foo | reverse >expected && 40 42 git rev-list --boundary --reverse --parents --full-history \ 41 43 main ^root -- foo > actual && 42 44 test_cmp expected actual
+6
t/t6102-rev-list-unexpected-objects.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 + if ! test_have_prereq PERL_TEST_HELPERS 8 + then 9 + skip_all='skipping rev-list unexpected objects tests; Perl not available' 10 + test_done 11 + fi 12 + 7 13 test_expect_success 'setup well-formed objects' ' 8 14 blob="$(printf "foo" | git hash-object -w --stdin)" && 9 15 tree="$(printf "100644 blob $blob\tfoo" | git mktree)" &&
+1 -1
t/t6115-rev-list-du.sh
··· 22 22 disk_usage_slow () { 23 23 git rev-list --no-object-names "$@" | 24 24 git cat-file --batch-check="%(objectsize:disk)" | 25 - perl -lne '$total += $_; END { print $total}' 25 + awk '{ i += $1 } END { print i }' 26 26 } 27 27 28 28 # check behavior with given rev-list options; note that
+10 -5
t/t6300-for-each-ref.sh
··· 1216 1216 test_must_fail git for-each-ref --format="%(raw)" --tcl 1217 1217 ' 1218 1218 1219 - test_expect_success '%(raw) with --perl' ' 1219 + test_expect_success PERL_TEST_HELPERS '%(raw) with --perl' ' 1220 1220 git for-each-ref --format="\$name= %(raw); 1221 1221 print \"\$name\"" refs/myblobs/blob1 --perl | perl >actual && 1222 1222 cmp blob1 actual && ··· 1443 1443 ' 1444 1444 1445 1445 test_trailer_option () { 1446 + if test "$#" -eq 3 1447 + then 1448 + prereq="$1" 1449 + shift 1450 + fi && 1446 1451 title=$1 option=$2 1447 1452 cat >expect 1448 - test_expect_success "$title" ' 1453 + test_expect_success $prereq "$title" ' 1449 1454 git for-each-ref --format="%($option)" refs/heads/main >actual && 1450 1455 test_cmp expect actual && 1451 1456 git for-each-ref --format="%(contents:$option)" refs/heads/main >actual && ··· 1453 1458 ' 1454 1459 } 1455 1460 1456 - test_trailer_option '%(trailers:unfold) unfolds trailers' \ 1461 + test_trailer_option PERL_TEST_HELPERS '%(trailers:unfold) unfolds trailers' \ 1457 1462 'trailers:unfold' <<-EOF 1458 1463 $(unfold <trailers) 1459 1464 ··· 1483 1488 1484 1489 EOF 1485 1490 1486 - test_trailer_option '%(trailers:only) and %(trailers:unfold) work together' \ 1491 + test_trailer_option PERL_TEST_HELPERS '%(trailers:only) and %(trailers:unfold) work together' \ 1487 1492 'trailers:only,unfold' <<-EOF 1488 1493 $(grep -v patch.description <trailers | unfold) 1489 1494 1490 1495 EOF 1491 1496 1492 - test_trailer_option '%(trailers:unfold) and %(trailers:only) work together' \ 1497 + test_trailer_option PERL_TEST_HELPERS '%(trailers:unfold) and %(trailers:only) work together' \ 1493 1498 'trailers:unfold,only' <<-EOF 1494 1499 $(grep -v patch.description <trailers | unfold) 1495 1500
+3 -3
t/t7006-pager.sh
··· 662 662 ' 663 663 664 664 test_expect_success 'setup large log output' ' 665 - perl -e " 666 - print \"this is a long commit message\" x 50000 667 - " >commit-msg && 665 + test-tool genzeros 50000 | 666 + tr "\000" "a" | 667 + sed "s/a/this is a long commit message/g" >commit-msg && 668 668 git commit --allow-empty -F commit-msg 669 669 ' 670 670
+2 -1
t/t7416-submodule-dash-url.sh
··· 33 33 ' 34 34 35 35 test_expect_success 'remove ./ protection from .gitmodules url' ' 36 - perl -i -pe "s{\./}{}" .gitmodules && 36 + sed "s|\./||" .gitmodules >.gitmodules.munged && 37 + mv .gitmodules.munged .gitmodules && 37 38 git commit -am "drop protection" 38 39 ' 39 40
+3 -3
t/t7501-commit-basic-functionality.sh
··· 46 46 test_must_fail git commit -m foo -a file 47 47 ' 48 48 49 - test_expect_success PERL 'can use paths with --interactive' ' 49 + test_expect_success 'can use paths with --interactive' ' 50 50 echo bong-o-bong >file && 51 51 # 2: update, 1:st path, that is all, 7: quit 52 52 test_write_lines 2 1 "" 7 | ··· 345 345 grep Rubber.Duck output 346 346 ' 347 347 348 - test_expect_success PERL 'interactive add' ' 348 + test_expect_success 'interactive add' ' 349 349 echo 7 | test_must_fail git commit --interactive >out && 350 350 grep "What now" out 351 351 ' 352 352 353 - test_expect_success PERL "commit --interactive doesn't change index if editor aborts" ' 353 + test_expect_success "commit --interactive doesn't change index if editor aborts" ' 354 354 echo zoo >file && 355 355 test_must_fail git diff --exit-code >diff1 && 356 356 test_write_lines u "*" q |
+1 -1
t/t7508-status.sh
··· 1066 1066 1067 1067 test_expect_success 'status -z implies porcelain' ' 1068 1068 git status --porcelain | 1069 - perl -pe "s/\012/\000/g" >expect && 1069 + tr "\012" "\000" >expect && 1070 1070 git status -z >output && 1071 1071 test_cmp expect output 1072 1072 '
+3 -6
t/t7815-grep-binary.sh
··· 114 114 test_cmp expect actual 115 115 ' 116 116 117 - cat >nul_to_q_textconv <<'EOF' 118 - #!/bin/sh 119 - "$PERL_PATH" -pe 'y/\000/Q/' < "$1" 120 - EOF 121 - chmod +x nul_to_q_textconv 122 - 123 117 test_expect_success 'setup textconv filters' ' 118 + write_script nul_to_q_textconv <<-\EOF && 119 + tr "\000" "Q" <"$1" 120 + EOF 124 121 echo a diff=foo >.gitattributes && 125 122 git config diff.foo.textconv "\"$(pwd)\""/nul_to_q_textconv 126 123 '
+6
t/t8001-annotate.sh
··· 7 7 TEST_CREATE_REPO_NO_TEMPLATE=1 8 8 . ./test-lib.sh 9 9 10 + if ! test_have_prereq PERL_TEST_HELPERS 11 + then 12 + skip_all='skipping annotate tests; Perl not available' 13 + test_done 14 + fi 15 + 10 16 PROG='git annotate' 11 17 . "$TEST_DIRECTORY"/annotate-tests.sh 12 18
+7 -1
t/t8002-blame.sh
··· 7 7 TEST_CREATE_REPO_NO_TEMPLATE=1 8 8 . ./test-lib.sh 9 9 10 + if ! test_have_prereq PERL_TEST_HELPERS 11 + then 12 + skip_all='skipping blame colors tests; Perl not available' 13 + test_done 14 + fi 15 + 10 16 PROG='git blame -c' 11 17 . "$TEST_DIRECTORY"/annotate-tests.sh 12 18 ··· 101 107 expect=$1 && shift && 102 108 echo $sha1 | cut -c 1-$expect >expect && 103 109 git blame "$@" abbrev.t >actual && 104 - perl -lne "/[0-9a-f]+/ and print \$&" <actual >actual.sha && 110 + sed -n "s/^[\^]\{0,1\}\([0-9a-f][0-9a-f]*\).*/\1/p" actual >actual.sha && 105 111 test_cmp expect actual.sha 106 112 } 107 113 '
+1 -1
t/t8006-blame-textconv.sh
··· 11 11 cat >helper <<'EOF' 12 12 #!/bin/sh 13 13 grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; } 14 - "$PERL_PATH" -p -e 's/^bin: /converted: /' "$1" 14 + sed 's/^bin: /converted: /' "$1" 15 15 EOF 16 16 chmod +x helper 17 17
+3 -3
t/t8011-blame-split-file.sh
··· 81 81 git blame --root -C --$output combined >output 82 82 ' 83 83 84 - test_expect_success "$output output finds correct commits" ' 84 + test_expect_success PERL_TEST_HELPERS "$output output finds correct commits" ' 85 85 generate_expect >expect <<-\EOF && 86 86 5 base 87 87 1 modified ··· 93 93 test_cmp expect actual 94 94 ' 95 95 96 - test_expect_success "$output output shows correct filenames" ' 96 + test_expect_success PERL_TEST_HELPERS "$output output shows correct filenames" ' 97 97 generate_expect >expect <<-\EOF && 98 98 11 one 99 99 11 two ··· 102 102 test_cmp expect actual 103 103 ' 104 104 105 - test_expect_success "$output output shows correct previous pointer" ' 105 + test_expect_success PERL_TEST_HELPERS "$output output shows correct previous pointer" ' 106 106 generate_expect >expect <<-EOF && 107 107 5 NONE 108 108 1 $(git rev-parse modified^) one
+6
t/t8012-blame-colors.sh
··· 7 7 TEST_CREATE_REPO_NO_TEMPLATE=1 8 8 . ./test-lib.sh 9 9 10 + if ! test_have_prereq PERL_TEST_HELPERS 11 + then 12 + skip_all='skipping blame colors tests; Perl not available' 13 + test_done 14 + fi 15 + 10 16 PROG='git blame -c' 11 17 . "$TEST_DIRECTORY"/annotate-tests.sh 12 18
+6 -4
t/t9137-git-svn-dcommit-clobber-series.sh
··· 20 20 test x"$(sed -n -e 61p < file)" = x61 && 21 21 svn_cmd co "$svnrepo" tmp && 22 22 (cd tmp && 23 - perl -i.bak -p -e "s/^58$/5588/" file && 24 - perl -i.bak -p -e "s/^61$/6611/" file && 23 + sed -e "s/^58$/5588/" -e "s/^61$/6611/" file >file.munged && 24 + mv file.munged file && 25 25 poke file && 26 26 test x"$(sed -n -e 58p < file)" = x5588 && 27 27 test x"$(sed -n -e 61p < file)" = x6611 && ··· 40 40 test_expect_success 'change file but in unrelated area' " 41 41 test x\"\$(sed -n -e 4p < file)\" = x4 && 42 42 test x\"\$(sed -n -e 7p < file)\" = x7 && 43 - perl -i.bak -p -e 's/^4\$/4444/' file && 44 - perl -i.bak -p -e 's/^7\$/7777/' file && 43 + sed -e 's/^4\$/4444/' \ 44 + -e 's/^7\$/7777/' \ 45 + file >file.munged && 46 + mv file.munged file && 45 47 test x\"\$(sed -n -e 4p < file)\" = x4444 && 46 48 test x\"\$(sed -n -e 7p < file)\" = x7777 && 47 49 git commit -m '4 => 4444, 7 => 7777' file &&
+1 -1
t/t9350-fast-export.sh
··· 726 726 (cd result && git show main:foo) 727 727 ' 728 728 729 - test_expect_success 'fast-export quotes pathnames' ' 729 + test_expect_success PERL_TEST_HELPERS 'fast-export quotes pathnames' ' 730 730 git init crazy-paths && 731 731 test_config -C crazy-paths core.protectNTFS false && 732 732 (cd crazy-paths &&
+1 -1
t/t9850-shell.sh
··· 30 30 ' 31 31 32 32 test_expect_success 'shell complains of overlong commands' ' 33 - perl -e "print \"a\" x 2**12 for (0..2**19)" | 33 + test-tool genzeros | tr "\000" "a" | 34 34 test_must_fail git shell 2>err && 35 35 grep "too long" err 36 36 '
+5 -15
t/test-lib-functions.sh
··· 88 88 } 89 89 90 90 lf_to_nul () { 91 - perl -pe 'y/\012/\000/' 91 + tr '\012' '\000' 92 92 } 93 93 94 94 nul_to_q () { 95 - perl -pe 'y/\000/Q/' 95 + tr '\000' 'Q' 96 96 } 97 97 98 98 q_to_nul () { 99 - perl -pe 'y/Q/\000/' 99 + tr 'Q' '\000' 100 100 } 101 101 102 102 q_to_cr () { ··· 1645 1645 1646 1646 # Read up to "$1" bytes (or to EOF) from stdin and write them to stdout. 1647 1647 test_copy_bytes () { 1648 - perl -e ' 1649 - my $len = $ARGV[1]; 1650 - while ($len > 0) { 1651 - my $s; 1652 - my $nread = sysread(STDIN, $s, $len); 1653 - die "cannot read: $!" unless defined($nread); 1654 - last unless $nread; 1655 - print $s; 1656 - $len -= $nread; 1657 - } 1658 - ' - "$1" 1648 + dd ibs=1 count="$1" 2>/dev/null 1659 1649 } 1660 1650 1661 1651 # run "$@" inside a non-git directory ··· 1994 1984 # Print the destination of symlink(s) provided as arguments. Basically 1995 1985 # the same as the readlink command, but it's not available everywhere. 1996 1986 test_readlink () { 1997 - perl -le 'print readlink($_) for @ARGV' "$@" 1987 + test-tool path-utils readlink "$@" 1998 1988 } 1999 1989 2000 1990 # Set mtime to a fixed "magic" timestamp in mid February 2009, before we
+31 -18
t/test-lib.sh
··· 499 499 # /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets 500 500 # deriving from the command substitution clustered with the other 501 501 # ones. 502 - unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e ' 503 - my @env = keys %ENV; 504 - my $ok = join("|", qw( 505 - TRACE 506 - DEBUG 507 - TEST 508 - .*_TEST 509 - PROVE 510 - VALGRIND 511 - UNZIP 512 - PERF_ 513 - CURL_VERBOSE 514 - TRACE_CURL 515 - BUILD_DIR 516 - )); 517 - my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env); 518 - print join("\n", @vars); 519 - ') 502 + unset VISUAL EMAIL LANGUAGE $(env | sed -n \ 503 + -e '/^GIT_TRACE/d' \ 504 + -e '/^GIT_DEBUG/d' \ 505 + -e '/^GIT_TEST/d' \ 506 + -e '/^GIT_.*_TEST/d' \ 507 + -e '/^GIT_PROVE/d' \ 508 + -e '/^GIT_VALGRIND/d' \ 509 + -e '/^GIT_UNZIP/d' \ 510 + -e '/^GIT_PERF_/d' \ 511 + -e '/^GIT_CURL_VERBOSE/d' \ 512 + -e '/^GIT_TRACE_CURL/d' \ 513 + -e '/^GIT_BUILD_DIR/d' \ 514 + -e 's/^\(GIT_[^=]*\)=.*/\1/p' 515 + ) 520 516 unset XDG_CACHE_HOME 521 517 unset XDG_CONFIG_HOME 522 518 unset GITPERLLIB ··· 1523 1519 export LSAN_OPTIONS 1524 1520 fi 1525 1521 1522 + if test -z "$PERL_PATH" 1523 + then 1524 + case "${GIT_TEST_CHAIN_LINT:-unset}" in 1525 + unset) 1526 + GIT_TEST_CHAIN_LINT=0 1527 + ;; 1528 + 0) 1529 + # The user has explicitly disabled the chain linter, so we 1530 + # don't have anything to worry about. 1531 + ;; 1532 + *) 1533 + BAIL_OUT 'You need Perl for the chain linter' 1534 + ;; 1535 + esac 1536 + fi 1537 + 1526 1538 if test "${GIT_TEST_CHAIN_LINT:-1}" != 0 && 1527 1539 test "${GIT_TEST_EXT_CHAIN_LINT:-1}" != 0 1528 1540 then ··· 1694 1706 test -z "$NO_GETTEXT" && test_set_prereq GETTEXT 1695 1707 test -n "$SANITIZE_LEAK" && test_set_prereq SANITIZE_LEAK 1696 1708 test -n "$GIT_VALGRIND_ENABLED" && test_set_prereq VALGRIND 1709 + test -n "$PERL_PATH" && test_set_prereq PERL_TEST_HELPERS 1697 1710 1698 1711 if test -z "$GIT_TEST_CHECK_CACHE_TREE" 1699 1712 then