From: Ian Jackson Date: Wed, 12 Mar 2014 18:34:43 +0000 (+0000) Subject: tests: drs-push-rejects: malformed tags of various kinds X-Git-Tag: debian/0.22~41 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=3fde94933fce6b3b0bfefda8d7dab486a6d22bc8;ds=sidebyside tests: drs-push-rejects: malformed tags of various kinds --- diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects index 73de5eca..36d4dab9 100755 --- a/tests/tests/drs-push-rejects +++ b/tests/tests/drs-push-rejects @@ -71,6 +71,39 @@ tag_signer='-a' mktag mustfail 'missing signature' $push_spec +git cat-file tag $tag_name >goodtag + +for h in object type tag; do + for how in missing dupe; do + + case $how in + missing) perl -pe 's/^tag /wombat$&/ if 1..m/^$/' badtag ;; + dupe) perl -pe 'print if 1..m/^$/ and m/^'$h' /' badtag ;; + esac + + rm -f badtag.asc + gpg --detach-sign --armor -u Senatus badtag + cat badtag.asc >>badtag + + set +e + LC_ALL=C git hash-object -w -t tag badtag >badtag.hash 2>badtag.err + rc=$? + set -e + + if [ $rc = 128 ] && grep 'fatal: corrupt tag' badtag.err; then + continue + elif [ $rc != 0 ]; then + cat badtag.err + fail "could not make tag" + fi + + read