summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-03-05 18:28:19 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-03-05 18:29:08 +0000
commitb0f42dfd0c14ae08320db39f9bb7d3a89c20f14f (patch)
tree7ce9e88b7fd077146a0574e22db51eb8d52e0513
parent147d4c3503f1a938cca248d3f23d914ba7eb6c93 (diff)
tests: drs-push-rejects: check that failures do not update any refs
-rwxr-xr-xtests/tests/drs-push-rejects11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects
index 9b2a08b..f6b5880 100755
--- a/tests/tests/drs-push-rejects
+++ b/tests/tests/drs-push-rejects
@@ -10,8 +10,17 @@ t-worktree drs
cd $p
+reporefs () {
+ (set -e
+ if test -d $tmp/git/$p.git; then
+ cd $tmp/git/$p.git
+ git show-ref
+ fi)
+}
+
mustfail () {
local wantmsg="$1"; shift
+ reporefs >$tmp/show-refs.pre-push
set +e
git push origin "$@" 2>&1 |tee $tmp/mustfail.txt
ps="${PIPESTATUS[*]}"
@@ -24,6 +33,8 @@ mustfail () {
if ! fgrep "$wantmsg" $tmp/mustfail.txt >/dev/null; then
fail "error message not found"
fi
+ reporefs >$tmp/show-refs.post-push
+ diff $tmp/show-refs.{pre,post}-push
}
prep () {