Re: [PATCH 2/4] t0021: put $TEST_ROOT in $PATH
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Nov 3, 2016, 20:40 UTC
- Message-ID
- <d36d8b51-f2d7-a2f5-89ea-369f49556e10@kdbg.org>
- In-Reply-To
- <20161102181824.mi6lmfnfckvrav7n@sigill.intra.peff.net>
Am 02.11.2016 um 19:18 schrieb Jeff King:
Show 24 quoted lines
> 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> > --- > t/t0021-conversion.sh | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh > index dfde22549..c1ad20c61 100755 > --- a/t/t0021-conversion.sh > +++ b/t/t0021-conversion.sh > @@ -5,6 +5,7 @@ test_description='blob conversion via gitattributes' > . ./test-lib.sh > > TEST_ROOT="$(pwd)" > +PATH=$TEST_ROOT:$PATH
This causes problems on Windows. We need the following squashed in.
---- 8< ---- [PATCH] squash! t0021: put $TEST_ROOT in $PATH
We have to use $PWD instead of $(pwd) because on Windows the latter would add a C: style path to bash's Unix-style $PATH variable, which becomes confused by the colon after the drive letter. ($PWD is a Unix-style path.)
Signed-off-by: Johannes Sixt <j6t@kdbg.org> --- t/t0021-conversion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index 4e4b9a6be3..cff2b7259d 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -4,7 +4,7 @@ test_description='blob conversion via gitattributes' . ./test-lib.sh -TEST_ROOT="$(pwd)" +TEST_ROOT="$PWD" PATH=$TEST_ROOT:$PATH write_script <<\EOF "$TEST_ROOT/rot13.sh"
-- 2.11.0.rc0.55.gd967357