chiark / gitweb /
Tests: Exercise policy periodic hook
[dgit.git] / tests / tests / push-newpackage
index eea5685a359a65bbc9e2413430c47adcffdf7da9..419ffd3e818c0f08f4f53e81d6df8c5414229821 100755 (executable)
@@ -2,22 +2,27 @@
 set -e
 . tests/lib
 
-t-archive-none pari-extra
-t-git-none
-t-worktree 3-1
-v=3-1
-cd $p
-git branch -m dgit/sid master
-git remote rm dgit
+t-prep-newpackage pari-extra 3-1
 
+cd $p
 t-refs-same-start
 t-ref-head
 
-LANG=C t-dgit push 2>&1 \
-       | tee /dev/stderr \
-       | grep 'package appears to be new in this suite' >/dev/null
+t-expect-fail 'package appears to be new in this suite' \
+t-dgit push
 
 t-dgit build
+
+git checkout bogus
+
+set +e
+(set -e; DGIT_TEST_DEBUG=' ' t-dgit push --new)
+rc=$?
+set -e
+if [ $rc = 0 ]; then fail "push succeeded when tree mismatch"; fi
+
+git checkout master
+
 t-dgit push --new
 
 t-pushed-good master