Jeff King <peff@xxxxxxxx> 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@xxxxxxxxxxx -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@xxxxxxxxxxx -m "Another message" o-signed-tag + +' + cat >sigmsgfile <<EOF Another signed tag message in a file. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html