From f272696a35678438a1edd0ad1d23c8c110ede3e5 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 2 Nov 2016 14:20:22 -0400 Subject: t0021: use $PERL_PATH for rot13-filter.pl The rot13-filter.pl script hardcodes "#!/usr/bin/perl", and does not respect $PERL_PATH at all. That is a problem if the system does not have perl at that path, or if it has a perl that is too old to run a complicated script like the rot13-filter (but PERL_PATH points to a more modern one). We can fix this by using write_script() to create a new copy of the script with the correct #!-line. In theory we could move the whole script inside t0021-conversion.sh rather than having it as an auxiliary file, but it's long enough that it just makes things harder to read. As a bonus, we can stop using the full path to the script in the filter-process config we add (because the trash directory is in our PATH). Not only is this shorter, but it sidesteps any shell-quoting issues. The original was broken when $TEST_DIRECTORY contained a space, because it was interpolated in the outer script. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t0021/rot13-filter.pl | 1 - 1 file changed, 1 deletion(-) mode change 100755 => 100644 t/t0021/rot13-filter.pl (limited to 't/t0021') diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl old mode 100755 new mode 100644 index ae4c50f5c5..e3ea58e1ed --- a/t/t0021/rot13-filter.pl +++ b/t/t0021/rot13-filter.pl @@ -1,4 +1,3 @@ -#!/usr/bin/perl # # Example implementation for the Git filter protocol version 2 # See Documentation/gitattributes.txt, section "Filter Protocol" -- cgit v1.2.3