From: Ian Jackson Date: Wed, 10 Jun 2015 20:29:52 +0000 (+0100) Subject: Test suite: t-expect-push-fail checks HEAD object did not arrive X-Git-Tag: debian/0.30~94 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=2212a3b83e5e983a6d2b65a491287fa3d6bdbbbc Test suite: t-expect-push-fail checks HEAD object did not arrive --- diff --git a/tests/lib b/tests/lib index 03c25ce3..5b93d98d 100644 --- a/tests/lib +++ b/tests/lib @@ -74,15 +74,22 @@ t-expect-fail () { t-expect-push-fail () { local mpat="$1"; shift + + local triedpush=`git rev-parse HEAD` + t-reporefs pre-push t-expect-fail "$mpat" "$@" t-reporefs post-push diff $tmp/show-refs.{pre,post}-push + t-git-objects-not-present '' $triedpush + eval "$t_expect_push_fail_hook" } 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 obj if ! [ -e "$gitdir" ]; then return; fi diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject index 10af31fc..40f5db5d 100755 --- a/tests/tests/debpolicy-newreject +++ b/tests/tests/debpolicy-newreject @@ -85,4 +85,3 @@ cd $tmp/$p echo xxx up to here echo xxx want to test database lock retry thing on push-and-taint -echo xxx want to t-expect-push-fail leaves HEAD object not dest repo