From: Ian Jackson Date: Fri, 6 Jan 2017 17:11:03 +0000 (+0000) Subject: test suite: Break out t-make-badcommit X-Git-Tag: archive/debian/2.16~14 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=030ae37385ca7cb5d3ad6a05ecf381df15c49867 test suite: Break out t-make-badcommit Signed-off-by: Ian Jackson --- diff --git a/tests/lib b/tests/lib index 52aca71b..cf7d4cfb 100644 --- a/tests/lib +++ b/tests/lib @@ -898,6 +898,15 @@ t-gbp-example-prep () { remotes/dgit/dgit/sid } +t-make-badcommit () { + badcommit=$( + git cat-file commit HEAD | \ + perl -pe 's/^committer.*\n//' | \ + git hash-object -w -t commit --stdin + ) + t-expect-fsck-fail $badcommit +} + t-commit () { local msg=$1 v=${2:-${majorv:-1}.$revision} diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects index 8c4ad83c..4b7de340 100755 --- a/tests/tests/drs-push-rejects +++ b/tests/tests/drs-push-rejects @@ -141,13 +141,7 @@ mktag mustfail 'tag name in tag is wrong' \ refs/tags/$tagpfx/wombat:refs/tags/$tagpfx/$version $push_spec1 -echo ==== -badcommit=$( - git cat-file commit HEAD | \ - perl -pe 's/^committer.*\n//' | \ - git hash-object -w -t commit --stdin -) -t-expect-fsck-fail $badcommit +t-make-badcommit git checkout -b broken $badcommit prep unstable sid mktag