chiark / gitweb /
Test suite: Filter out .../git-core from PATH so that we catch git-foo
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Oct 2016 12:07:59 +0000 (13:07 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Oct 2016 12:11:49 +0000 (13:11 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/lib
tests/lib-core

index 9bf33e4..e35438e 100644 (file)
@@ -1,7 +1,8 @@
 dgit (2.1~~) unstable; urgency=medium
 
   * git- prefixes: Fix some occurrences of `git-foo' in infrastructure,
-    messages, and test suite.
+    messages, and test suite.  Filter out .../git-core from PATH in
+    test suite so that we catch future occurrences.
 
  --
 
index 6401f93..275d3ef 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -21,6 +21,8 @@ END
 
 trap 'test $? = 0 || t-report-failure' EXIT
 
+t-filter-out-git-hyphen-dir
+
 t-set-intree
 
 : ${DGIT_TEST_DEBUG=-D}
index f3881ca..b01a6ea 100644 (file)
@@ -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"
+}