]> git.ipfire.org Git - thirdparty/git.git/commit
t/lib-httpd: pass PERL_PATH to CGI scripts
authorJeff King <peff@peff.net>
Thu, 6 Apr 2023 09:36:02 +0000 (05:36 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Apr 2023 16:29:43 +0000 (09:29 -0700)
commitc1917156a04e371f33cc344af093a8b237e09eb1
tree7bfe37aa4e7ec668aa2763d43309912fff43e4f7
parent7556e5d737b917d31ac3729b0f5e2391da7e132a
t/lib-httpd: pass PERL_PATH to CGI scripts

As discussed in t/README, tests should aim to use PERL_PATH rather than
straight "perl". We usually do this automatically with a "perl" function
in test-lib.sh, but a few cases need to be handled specially.

One such case is the apply-one-time-perl.sh CGI, which invokes plain
"perl". It should be using $PERL_PATH, but to make that work, we must
also instruct Apache to pass through the variable.

Prior to this patch, doing:

  mv /usr/bin/perl /usr/bin/my-perl
  make PERL_PATH=/usr/bin/my-perl test

would fail t5702, t5703, and t5616. After this it passes. This is a
pretty extreme case, as even if you install perl elsewhere, you'd likely
still have it in your $PATH. A more realistic case is that you don't
want to use the perl in your $PATH (because it's older, broken, etc) and
expect PERL_PATH to consistently override that (since that's what it's
documented to do). Removing it completely is just a convenient way of
completely breaking it for testing purposes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-httpd/apache.conf
t/lib-httpd/apply-one-time-perl.sh