summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib13
-rwxr-xr-xtests/tests/clone-gitnosuite2
-rwxr-xr-xtests/tests/debpolicy-newreject2
-rwxr-xr-xtests/tests/drs-push-masterupdate6
-rwxr-xr-xtests/tests/tag-updates2
-rwxr-xr-xtests/tests/trustingpolicy-replay2
6 files changed, 14 insertions, 13 deletions
diff --git a/tests/lib b/tests/lib
index ebfe5a7..046d362 100644
--- 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`
diff --git a/tests/tests/clone-gitnosuite b/tests/tests/clone-gitnosuite
index 6eee251..6b1c937 100755
--- a/tests/tests/clone-gitnosuite
+++ b/tests/tests/clone-gitnosuite
@@ -4,6 +4,6 @@ set -e
t-archive pari-extra 3-1
t-git-none
-cp -a $tmp/git/_template $tmp/git/$p.git
+cp -a $tmp/git/_template $dgitrepo
t-dgit clone $p
diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject
index 8bc0c86..3f3114b 100755
--- a/tests/tests/debpolicy-newreject
+++ b/tests/tests/debpolicy-newreject
@@ -82,7 +82,7 @@ t-dgit --deliberately-TEST-dgit-only-not-fast-forward push
t-dgit --deliberately-not-fast-forward push
-cd $tmp/git/$p.git
+cd $dgitrepo
t-expect-push-fail "Not a valid object name" \
git cat-file -p $oldobj
cd $tmp/$p
diff --git a/tests/tests/drs-push-masterupdate b/tests/tests/drs-push-masterupdate
index b5523e8..9d2e632 100755
--- a/tests/tests/drs-push-masterupdate
+++ b/tests/tests/drs-push-masterupdate
@@ -16,9 +16,9 @@ t-dgit build
t-dgit push --new
push_and_check () {
- git push $tmp/git/$p.git $1
+ git push $dgitrepo $1
- oldmaster=`cd $tmp/git/$p.git && t-git-get-ref refs/heads/master`
+ oldmaster=`cd $dgitrepo && t-git-get-ref refs/heads/master`
t-refs-same-start
git checkout master
@@ -38,7 +38,7 @@ t_check_pushed_master=t-check-master-undisturbed
git checkout -b divergent common-ancestor
git commit --allow-empty -m 'Has common ancestor'
-git push $tmp/git/$p.git HEAD:master
+git push $dgitrepo HEAD:master
push_and_check HEAD:master
diff --git a/tests/tests/tag-updates b/tests/tests/tag-updates
index 544be16..1ef7dcd 100755
--- a/tests/tests/tag-updates
+++ b/tests/tests/tag-updates
@@ -14,7 +14,7 @@ tagref=`t-v-tag`
tagname=${tn#refs/tags}
(set -e
- cd $tmp/git/$p.git
+ cd $dgitrepo
git tag -m UNWANTED unwanted dgit/sid)
fetch-check () {
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index f2a7043..b779f64 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -67,7 +67,7 @@ attempt-replay () {
prepare-replay --deliberately-fresh-repo
# simulate some other thing that we shouldn't delete
-git push $tmp/git/$p.git +master:refs/heads/for-testing
+git push $dgitrepo +master:refs/heads/for-testing
attempt-replay 'does not declare previously heads/for-testing'