chiark / gitweb /
Test suite: Replace open-coded $tmp/git/$p.git
[dgit.git] / tests / lib
index ebfe5a788bdc3f41f45c31c36cba0c137b3a1c54..046d36289c1145b53d37f7b7d1dbd4d575e4d9b2 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -92,7 +92,7 @@ t-expect-push-fail () {
 t-git-objects-not-present () {
        # t-git-objects-not-present GITDIR|'' OBJID [...]
        # specifying '' means the repo for package $p
-       local gitdir="${1-$tmp/git/$p.git}"
+       local gitdir="${1-$dgitrepo}"
        local obj
        if ! [ -e "$gitdir" ]; then return; fi
        for obj in "$@"; do
@@ -107,8 +107,8 @@ t-reporefs () {
        local outputfile="$tmp/show-refs.$whichoutput"
        (set -e
         exec >"$outputfile"
-        if test -d $tmp/git/$p.git; then
-               cd $tmp/git/$p.git
+        if test -d $dgitrepo; then
+               cd $dgitrepo
                git show-ref |sort
        fi)
 }
@@ -130,6 +130,7 @@ t-worktree () {
 
 t-select-package () {
        p=$1
+       dgitrepo=$tmp/git/$p.git
 }
 
 t-git () {
@@ -251,11 +252,11 @@ t-archive () {
 }
 
 t-git-dir-time-passes () {
-       touch -d 'last year' $tmp/git/$p.git
+       touch -d 'last year' $dgitrepo
 }
 
 t-git-dir-check () {
-       local gitdir=$tmp/git/$p.git
+       local gitdir=$dgitrepo
        case "$1" in
        enoent)
                if test -e "$gitdir"; then fail "$gitdir exists"; fi
@@ -407,7 +408,7 @@ t-pushed-good () {
        t-refs-notexist \
                refs/heads/dgit/unstable \
                refs/remotes/dgit/dgit/unstable
-       (set -e; cd $tmp/git/$p.git
+       (set -e; cd $dgitrepo
         t-refs-same \
                refs/dgit/sid \
                `t-v-tag`