Re: [PATCH] t7004: test that "git-tag -u" implies "-s"

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Monday, December 10, 2007 - 9:38 pm

Jeff King <peff@peff.net> writes:


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 <<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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
&quot;git tag -u keyname&quot; broken, Linus Torvalds, (Mon Dec 10, 9:08 pm)
Re: [PATCH] t7004: test that "git-tag -u" implies "-s", Junio C Hamano, (Mon Dec 10, 9:38 pm)