Git fork

t5703: refactor test to not depend on Perl

We use Perl due to two different reasons in t5703:

- To filter advertised capabilities.

- To set up a CGI script with HTTPD.

Refactor the first category to use `test_grep` instead. Refactoring the
second category would be a bit more involved, so instead we add the
PERL_TEST_HELPERS prerequisite to those individual tests now.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
7a7b6022 88bef8db

+8 -17
+8 -17
t/t5703-upload-pack-ref-in-want.sh
··· 4 4 5 5 . ./test-lib.sh 6 6 7 - if ! test_have_prereq PERL_TEST_HELPERS 8 - then 9 - skip_all='skipping upload-pack ref-in-want tests; Perl not available' 10 - test_done 11 - fi 12 - 13 7 get_actual_refs () { 14 8 sed -n -e '/wanted-refs/,/0001/{ 15 9 /wanted-refs/d ··· 89 83 90 84 test_expect_success 'config controls ref-in-want advertisement' ' 91 85 test-tool serve-v2 --advertise-capabilities >out && 92 - perl -ne "/ref-in-want/ and print" out >out.filter && 93 - test_must_be_empty out.filter && 86 + test_grep ! "ref-in-want" out && 94 87 95 88 git config uploadpack.allowRefInWant false && 96 89 test-tool serve-v2 --advertise-capabilities >out && 97 - perl -ne "/ref-in-want/ and print" out >out.filter && 98 - test_must_be_empty out.filter && 90 + test_grep ! "ref-in-want" out && 99 91 100 92 git config uploadpack.allowRefInWant true && 101 93 test-tool serve-v2 --advertise-capabilities >out && 102 - perl -ne "/ref-in-want/ and print" out >out.filter && 103 - test_file_not_empty out.filter 94 + test_grep "ref-in-want" out 104 95 ' 105 96 106 97 test_expect_success 'invalid want-ref line' ' ··· 486 477 EOF 487 478 } 488 479 489 - 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' ' 490 481 git -C "$REPO" config uploadpack.allowRefInWant false && 491 482 rm -rf local && 492 483 cp -r "$LOCAL_PRISTINE" local && ··· 495 486 test_grep "fatal: remote error: upload-pack: not our ref" err 496 487 ' 497 488 498 - test_expect_success 'server is initially ahead - ref in want' ' 489 + test_expect_success PERL_TEST_HELPERS 'server is initially ahead - ref in want' ' 499 490 git -C "$REPO" config uploadpack.allowRefInWant true && 500 491 rm -rf local && 501 492 cp -r "$LOCAL_PRISTINE" local && ··· 507 498 test_cmp expected actual 508 499 ' 509 500 510 - 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' ' 511 502 git -C "$REPO" config uploadpack.allowRefInWant false && 512 503 rm -rf local && 513 504 cp -r "$LOCAL_PRISTINE" local && ··· 519 510 test_cmp expected actual 520 511 ' 521 512 522 - test_expect_success 'server is initially behind - ref in want' ' 513 + test_expect_success PERL_TEST_HELPERS 'server is initially behind - ref in want' ' 523 514 git -C "$REPO" config uploadpack.allowRefInWant true && 524 515 rm -rf local && 525 516 cp -r "$LOCAL_PRISTINE" local && ··· 531 522 test_cmp expected actual 532 523 ' 533 524 534 - test_expect_success 'server loses a ref - ref in want' ' 525 + test_expect_success PERL_TEST_HELPERS 'server loses a ref - ref in want' ' 535 526 git -C "$REPO" config uploadpack.allowRefInWant true && 536 527 rm -rf local && 537 528 cp -r "$LOCAL_PRISTINE" local &&