chiark / gitweb /
test suite: Test bad commit defence in drs-push-rejects
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 5 Jan 2017 13:47:40 +0000 (13:47 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 5 Jan 2017 13:47:40 +0000 (13:47 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/tests/drs-push-rejects

index f87cbdc..7b7c5f3 100755 (executable)
@@ -139,6 +139,18 @@ 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
+)
+git checkout -b broken $badcommit
+prep unstable sid
+mktag
+mustfail "corrupted object $badcommit" $push_spec
+
+git checkout dgit/sid
 prep unstable sid
 mktag
 mustsucceed $push_spec # succeeds