summaryrefslogtreecommitdiff
path: root/tests/lib-core
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-16 13:07:59 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-16 13:11:49 +0100
commita85458a7fc736f6d404622a427380a41f1248765 (patch)
tree81c8569dcff07e4b868004c9e20759528bdc5e58 /tests/lib-core
parent3c2a1558b51d714fff35f1f053c10021219a6fe0 (diff)
Test suite: Filter out .../git-core from PATH so that we catch git-foo
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/lib-core')
-rw-r--r--tests/lib-core11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib-core b/tests/lib-core
index f3881ca..b01a6ea 100644
--- a/tests/lib-core
+++ b/tests/lib-core
@@ -21,3 +21,14 @@ t-set-using-tmp () {
export DGIT_TEST_TMP=$tmp
export GNUPGHOME=$tmp/gnupg
}
+
+t-filter-out-git-hyphen-dir () {
+ local pathent=$(type -p git-rev-parse ||:)
+ case "$pathent" in '') return ;; esac
+ pathent=${pathent%/*}
+ local path=":$PATH:"
+ path="${path//:$pathent:/}"
+ path="${path#:}"
+ path="${path%:}"
+ PATH="$path"
+}