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 9bf33e4f55b07809b415577b14e124e5d0498d42..e35438e2a4e0d28edd79f9ec90c8454ded87d6bf 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 6401f933c9989ec169899500a6c215bbef8113b2..275d3ef3f2824e89dc64453f41a106d133f5619d 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 f3881ca561c008c407ca24755cdc9facce646039..b01a6eae5cda188dde8700bc7e621998319309d8 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"
+}