From b0f42dfd0c14ae08320db39f9bb7d3a89c20f14f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 5 Mar 2014 18:28:19 +0000 Subject: tests: drs-push-rejects: check that failures do not update any refs --- tests/tests/drs-push-rejects | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/tests/drs-push-rejects') 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 () { -- cgit v1.2.3