From: Junio C Hamano Date: Tue, 11 Dec 2007 04:38:31 GMT Subject: Re: [PATCH] t7004: test that "git-tag -u" implies "-s" Message-ID: <7v63z5j16g.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20071211042436.GA23805@coredump.intra.peff.net> Jeff King writes: > Looks good to me, and here's a test. It was trivial to whip up, since I > wrote a test for almost the identical bug a few days ago (that one was > "-s implies -a"). Looks good to me. We should verify both common forms of key-id and also check a negative case. This squashes a few of mine on top of yours. --- t/t7004-tag.sh | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index c7130c4..a502286 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -640,6 +640,32 @@ test_expect_success 'creating a signed tag with -m message should succeed' ' git diff expect actual ' +get_tag_header implied-sign $commit commit $time >expect +echo 'Another signed tag' >>expect +echo '-----BEGIN PGP SIGNATURE-----' >>expect +test_expect_success '-u implies signed tag' ' + git-tag -u CDDE430D -m "Another signed tag" implied-sign && + get_tag_msg implied-sign >actual && + git diff expect actual +' + +get_tag_header u-signed-tag $commit commit $time >expect +echo 'Another message' >>expect +echo '-----BEGIN PGP SIGNATURE-----' >>expect +test_expect_success 'sign with a given key id' ' + + git tag -u committer@example.com -m "Another message" u-signed-tag && + get_tag_msg u-signed-tag >actual && + git diff expect actual + +' + +test_expect_success 'sign with an unknown id' ' + + ! git tag -u author@example.com -m "Another message" o-signed-tag + +' + cat >sigmsgfile <