X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Fdrs-push-rejects;h=e80620daafe11233289f6a81727688d193ae6923;hb=523f605a62b7f559108b8b7301a88bfaaeb6d4e8;hp=640aeae6914cbe8630488b21d3e4be68ad7b3de0;hpb=9f377842120dd8d6206a3f3f2eb297b3e4907fa8;p=dgit.git diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects index 640aeae6..e80620da 100755 --- a/tests/tests/drs-push-rejects +++ b/tests/tests/drs-push-rejects @@ -11,22 +11,9 @@ t-worktree drs cd $p mustfail () { - local wantmsg="$1"; shift - t-reporefs pre-push - set +o pipefail - 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 post-push - diff $tmp/show-refs.{pre,post}-push + local mpat="$1"; shift + t-expect-push-fail "$mpat" \ + git push origin "$@" } mustsucceed () {