From: Ian Jackson Date: Fri, 10 Jul 2015 23:35:28 +0000 (+0100) Subject: Test suite: Replace open-coded $tmp/git/$p.git X-Git-Tag: debian/1.0~48 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=c17699d17f17f6ea105b7440ff95fa39eebb54a6 Test suite: Replace open-coded $tmp/git/$p.git --- diff --git a/tests/lib b/tests/lib index ebfe5a78..046d3628 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 6eee2515..6b1c9375 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 8bc0c860..3f3114b2 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 b5523e82..9d2e6320 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 544be162..1ef7dcdc 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 f2a70431..b779f64b 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'