summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/lib8
-rwxr-xr-xtests/tests/drs-push-rejects9
2 files changed, 10 insertions, 7 deletions
diff --git a/tests/lib b/tests/lib
index c91020b..f45dd0b 100644
--- a/tests/lib
+++ b/tests/lib
@@ -72,6 +72,14 @@ t-expect-fail () {
fail "error message not found"
}
+t-expect-push-fail () {
+ local mpat="$1"; shift
+ t-reporefs pre-push
+ t-expect-fail "$mpat" "$@"
+ t-reporefs post-push
+ diff $tmp/show-refs.{pre,post}-push
+}
+
t-reporefs () {
local whichoutput=$1; shift
local outputfile="$tmp/show-refs.$whichoutput"
diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects
index 13567c3..e80620d 100755
--- a/tests/tests/drs-push-rejects
+++ b/tests/tests/drs-push-rejects
@@ -12,13 +12,8 @@ cd $p
mustfail () {
local mpat="$1"; shift
- t-reporefs pre-push
-
- t-expect-fail "$mpat" \
- git push origin "$@" 2>&1 |tee $tmp/mustfail.txt
-
- t-reporefs post-push
- diff $tmp/show-refs.{pre,post}-push
+ t-expect-push-fail "$mpat" \
+ git push origin "$@"
}
mustsucceed () {