summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-09 12:22:42 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-09 13:08:31 +0000
commit4c85f5a65adbe2a96f0690788a25146950b31397 (patch)
treee806cfb022d77c73b0b089d4afe66a7331df9af7
parent9fd10d6d6a5b67cbba36a82c1ea5342526c32d50 (diff)
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_<FOO> is not set. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--tests/lib9
1 files changed, 8 insertions, 1 deletions
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