t0021: put $TEST_ROOT in $PATH
We create a rot13.sh script in the trash directory, but need to call it by its full path when we have moved our cwd to another directory. Let's just put $TEST_ROOT in our $PATH so that the script is always found. This is a minor convenience for rot13.sh, but will be a major one when we switch rot13-filter.pl to a script in the same directory, as it means we will not have to deal with shell quoting inside the filter-process config. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Nov 2, 2016 at 14:18 UTC
30030a36b6428e5e4b259b88bfac615ff253fd9f
1 file changed
+4
-3
t/t0021-conversion.sh
+4
-3
@@ -5,6 +5,7 @@ test_description='blob conversion via gitattributes'
5
. ./test-lib.sh
6
7
TEST_ROOT="$(pwd)"
8
+PATH=$TEST_ROOT:$PATH
9
10
write_script <<\EOF "$TEST_ROOT/rot13.sh"
11
tr \
@@ -64,7 +65,7 @@ test_cmp_exclude_clean () {
65
# is equal to the committed content.
66
test_cmp_committed_rot13 () {
67
test_cmp "$1" "$2" &&
67
- "$TEST_ROOT/rot13.sh" <"$1" >expected &&
68
+ rot13.sh <"$1" >expected &&
69
git cat-file blob :"$2" >actual &&
70
test_cmp expected actual
71
}
@@ -513,7 +514,7 @@ test_expect_success PERL 'required process filter should process multiple packet
514
for FILE in "$TEST_ROOT"/*.file
515
do
516
cp "$FILE" . &&
516
- "$TEST_ROOT/rot13.sh" <"$FILE" >"$FILE.rot13"
517
+ rot13.sh <"$FILE" >"$FILE.rot13"
518
done &&
519
520
echo "*.file filter=protocol" >.gitattributes &&
@@ -616,7 +617,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
617
618
# Smudge failed
619
! test_cmp smudge-write-fail.o smudge-write-fail.r &&
619
- "$TEST_ROOT/rot13.sh" <smudge-write-fail.o >expected &&
620
+ rot13.sh <smudge-write-fail.o >expected &&
621
git cat-file blob :smudge-write-fail.r >actual &&
622
test_cmp expected actual
623
)