Skip to content

Commit 30030a3

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cbb6707 commit 30030a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

t/t0021-conversion.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='blob conversion via gitattributes'
55
. ./test-lib.sh
66

77
TEST_ROOT="$(pwd)"
8+
PATH=$TEST_ROOT:$PATH
89

910
write_script <<\EOF "$TEST_ROOT/rot13.sh"
1011
tr \
@@ -64,7 +65,7 @@ test_cmp_exclude_clean () {
6465
# is equal to the committed content.
6566
test_cmp_committed_rot13 () {
6667
test_cmp "$1" "$2" &&
67-
"$TEST_ROOT/rot13.sh" <"$1" >expected &&
68+
rot13.sh <"$1" >expected &&
6869
git cat-file blob :"$2" >actual &&
6970
test_cmp expected actual
7071
}
@@ -513,7 +514,7 @@ test_expect_success PERL 'required process filter should process multiple packet
513514
for FILE in "$TEST_ROOT"/*.file
514515
do
515516
cp "$FILE" . &&
516-
"$TEST_ROOT/rot13.sh" <"$FILE" >"$FILE.rot13"
517+
rot13.sh <"$FILE" >"$FILE.rot13"
517518
done &&
518519
519520
echo "*.file filter=protocol" >.gitattributes &&
@@ -616,7 +617,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
616617
617618
# Smudge failed
618619
! 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 &&
620621
git cat-file blob :smudge-write-fail.r >actual &&
621622
test_cmp expected actual
622623
)

0 commit comments

Comments
 (0)