chiark / gitweb /
Test suite: Break out t-make-hook-link.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jul 2015 20:39:04 +0000 (21:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jul 2015 20:39:04 +0000 (21:39 +0100)
debian/changelog
tests/lib

index 6f5ac4d61308d6710c23ad5e664d0866d86f22e7..661c57bab719669b96b8ba539d3203ae9faff64c 100644 (file)
@@ -33,6 +33,7 @@ dgit (0.31~~) unstable; urgency=low
   Cleanups:
   * Remove an obsolete comment from the code.
   * Improve an error message from dgit-repos-policy-debian.
+  * Test suite: Break out t-make-hook-link.
   * Fix a manpage typo.
 
  --
index 1179fb093f8ed48535c60a5eaaf52fc7ae9de481..e81a62ad3dd381f438c39d2435e64280db39eba6 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -567,14 +567,20 @@ t-policy-nonexist () {
        ln -sf no-such-file-or-directory $drs_dispatch/policy-hook
 }
 
-t-policy () {
-       local policyhook=$1
-       policyhook=${DGIT_INFRA_PFX}$policyhook
-       case $policyhook in
+t-make-hook-link () {
+       local hook=$1 # in infra/
+       local linkpath=$2
+       hook=${DGIT_INFRA_PFX}$hook
+       case $hook in
        */*)    ;;
-       *)      policyhook=`type -P $policyhook` ;;
+       *)      hook=`type -P $hook` ;;
        esac
-       ln -sf "$policyhook" $drs_dispatch/policy-hook
+       ln -sf "$hook" $linkpath
+}
+
+t-policy () {
+       local policyhook=$1
+       t-make-hook-link $policyhook $drs_dispatch/policy-hook
 }
 
 t-debpolicy () {