From 4c85f5a65adbe2a96f0690788a25146950b31397 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Jan 2017 12:22:42 +0000 Subject: test suite: t-tstunt: When looking for real thing, strip stunt from PATH Otherwise if we run this again in a fresh environment, the wrapper may be on PATH even though DGIT_TEST_REAL_ is not set. Signed-off-by: Ian Jackson --- tests/lib | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/lib') diff --git a/tests/lib b/tests/lib index 1def3d3..1af0288 100644 --- a/tests/lib +++ b/tests/lib @@ -801,7 +801,14 @@ t-tstunt--save-real () { local rc local real set +e - real=$(type -p "$f") + real=$( + p=":$PATH:" + p="${p/:"$tmp/tstunt":/:}" + p="${p%:}" + p="${p#:}" + PATH="$p" + type -p "$f" + ) rc=$? set -e -- cgit v1.2.3