chiark / gitweb /
Infra: ssh-wrap: set PERLLIB and get name of script right
[dgit.git] / tests / lib
index e1bc6d941e8f66b60f1d4d5d1d089049e6da4bcc..70ad0b186d31ecc244717b355bd99ee02e160329 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -302,6 +302,16 @@ t-clean-on-branch () {
        t-output "## $1" git status -b --porcelain
 }
 
+t-git-get-ref-exact () {
+       local ref=$1
+       # does not dereference, unlike t-git-get-ref
+       case "$ref" in
+       refs/*) ;;
+       *) fail "t-git-get-ref-exact bad $ref" ;;
+       esac
+       git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
+}
+
 t-git-get-ref () {
        local ref=$1
        case "$ref" in
@@ -465,11 +475,21 @@ t-drs () {
  t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S "
  t-git-config dgit-distro.test-dummy.git-check true
  t-git-config dgit-distro.test-dummy.git-create true
-       cp $root/tests/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
-       cp $root/tests/suites $tmp/.
+       cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/.
+       cp $troot/suites $tmp/.
 
        drs_dispatch=$tmp/distro=test-dummy
        mkdir $drs_dispatch
+
+       if [ "x$DGIT_TEST_INTREE" = x ]; then
+               cat >&2 <<END
+dgit-repos-server is designed to run out of a git working tree
+cannot be tested in installed package (as DEP-8-intends)
+test skipped
+END
+               exit 0
+       fi
+
        ln -sf $root $drs_dispatch/dgit-live
        ln -sf $tmp/git $drs_dispatch/repos
        ln -sf $tmp/suites $tmp/dm.txt $drs_dispatch/