X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftests%2Fdrs-push-rejects;h=13567c3f3a7b771ca235af9589fdb5f8524310aa;hb=5d8e32854c1d89e337bc606d423634a667f9b0ff;hp=74ddd37adcc1f9100b5af629016ed4cb4066f253;hpb=e852e5f836f1016c9af35d331b6aacb3afe6a488;p=dgit.git diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects index 74ddd37a..13567c3f 100755 --- a/tests/tests/drs-push-rejects +++ b/tests/tests/drs-push-rejects @@ -11,28 +11,20 @@ t-worktree drs cd $p mustfail () { - local wantmsg="$1"; shift - t-reporefs >$tmp/show-refs.pre-push - set +o pipefail + local mpat="$1"; shift + t-reporefs pre-push + + t-expect-fail "$mpat" \ git push origin "$@" 2>&1 |tee $tmp/mustfail.txt - ps="${PIPESTATUS[*]}" - set -o pipefail - case $ps in - "0 0") fail "push unexpectedly succeeded (instead of: $wantmsg)" ;; - *" 0") ;; - *) fail "tee failed" ;; - esac - if ! fgrep "$wantmsg" $tmp/mustfail.txt >/dev/null; then - fail "error message not found" - fi - t-reporefs >$tmp/show-refs.post-push + + t-reporefs post-push diff $tmp/show-refs.{pre,post}-push } mustsucceed () { - t-reporefs >$tmp/show-refs.pre-push + t-reporefs pre-push git push origin "$@" - t-reporefs >$tmp/show-refs.post-push + t-reporefs post-push if diff $tmp/show-refs.{pre,post}-push >$tmp/show-refs.diff; then fail "no refs updated" fi