chiark / gitweb /
test suite: Break out t-make-badcommit
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Jan 2017 17:11:03 +0000 (17:11 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Jan 2017 18:32:14 +0000 (18:32 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/lib
tests/tests/drs-push-rejects

index 52aca71b6e27cb5818bba3f040f1f5bef76aca19..cf7d4cfb008fd3a3f87a60d4e67f02a45fc635c5 100644 (file)
--- 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}
index 8c4ad83cd75acee8b65d289d287404e8f4f05768..4b7de3408c9496137f609dfdf0ec1a6743a594d3 100755 (executable)
@@ -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