From 396865859918e9c7bf8ce74aae137c57da134610 Mon Sep 17 00:00:00 2001 From: Carlos Rica Date: Fri, 9 Nov 2007 14:42:56 +0100 Subject: Make builtin-tag.c use parse_options. Also, this removes those tests ensuring that repeated -m options don't allocate memory more than once, because now this is done after parsing options, using the last one when more are given. The same for -F. Signed-off-by: Carlos Rica Signed-off-by: Junio C Hamano --- t/t7004-tag.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 't') diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 5f7e388d7a..736f22e4a9 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -339,20 +339,14 @@ test_expect_success \ ' test_expect_success \ - 'trying to create tags giving many -m or -F options should fail' ' + 'trying to create tags giving both -m or -F options should fail' ' echo "message file 1" >msgfile1 && echo "message file 2" >msgfile2 && ! tag_exists msgtag && - ! git-tag -m "message 1" -m "message 2" msgtag && - ! tag_exists msgtag && - ! git-tag -F msgfile1 -F msgfile2 msgtag && - ! tag_exists msgtag && ! git-tag -m "message 1" -F msgfile1 msgtag && ! tag_exists msgtag && ! git-tag -F msgfile1 -m "message 1" msgtag && ! tag_exists msgtag && - ! git-tag -F msgfile1 -m "message 1" -F msgfile2 msgtag && - ! tag_exists msgtag && ! git-tag -m "message 1" -F msgfile1 -m "message 2" msgtag && ! tag_exists msgtag ' -- cgit v1.2.1 From 10507857fe8c5d8774d016a8542c8dd572271a8a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 25 Nov 2007 23:50:58 -0500 Subject: git-tag: test that -s implies an annotated tag This detects a regression introduced while moving git-tag to a C builtin. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t7004-tag.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 't') diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 736f22e4a9..c7130c4dcc 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -667,6 +667,22 @@ test_expect_success 'creating a signed tag with -F - should succeed' ' git diff expect actual ' +cat >fakeeditor <<'EOF' +#!/bin/sh +test -n "$1" && exec >"$1" +echo A signed tag message +echo from a fake editor. +EOF +chmod +x fakeeditor +get_tag_header implied-annotate $commit commit $time >expect +./fakeeditor >>expect +echo '-----BEGIN PGP SIGNATURE-----' >>expect +test_expect_success '-s implies annotated tag' ' + GIT_EDITOR=./fakeeditor git-tag -s implied-annotate && + get_tag_msg implied-annotate >actual && + git diff expect actual +' + test_expect_success \ 'trying to create a signed tag with non-existing -F file should fail' ' ! test -f nonexistingfile && -- cgit v1.2.1