diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-06 17:11:03 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-06 18:32:14 +0000 |
commit | 030ae37385ca7cb5d3ad6a05ecf381df15c49867 (patch) | |
tree | 217fb7317ea31ad8c1720c79ac5343564b79017f | |
parent | aabdadcbfdfd7fc158966f9e680e4b04fad41332 (diff) |
test suite: Break out t-make-badcommit
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | tests/lib | 9 | ||||
-rwxr-xr-x | tests/tests/drs-push-rejects | 8 |
2 files changed, 10 insertions, 7 deletions
@@ -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 8c4ad83..4b7de34 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 |