diff mbox series

[2/3] t7004: ensure recursive tag behavior is working

Message ID d545bed9d3686b41ba67cfb25e00bb5a8b61c77b.1553586707.git.liu.denton@gmail.com (mailing list archive)
State New, archived
Headers show
Series tag: prevent recursive tags | expand

Commit Message

Denton Liu March 26, 2019, 7:53 a.m. UTC
Add tests to ensure that recursive tags are disallowed unless the
"--allow-recursive-tag" option is provided.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 t/t7004-tag.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Ævar Arnfjörð Bjarmason March 26, 2019, 10:11 a.m. UTC | #1
On Tue, Mar 26 2019, Denton Liu wrote:

> Add tests to ensure that recursive tags are disallowed unless the
> "--allow-recursive-tag" option is provided.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  t/t7004-tag.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
> index 7a7c0ccee9..5297da952d 100755
> --- a/t/t7004-tag.sh
> +++ b/t/t7004-tag.sh
> @@ -1700,6 +1700,14 @@ test_expect_success '--points-at finds annotated tags of tags' '
>  	test_cmp expect actual
>  '
>
> +test_expect_success 'recursive tagging should fail without --allow-recursive-tag' '
> +	test_must_fail git tag -m recursive recursive annotated-v4.0
> +'
> +
> +test_expect_success 'recursive tagging should pass with --allow-recursive-tag' '
> +	git tag --allow-recursive-tag -m recursive recursive annotated-v4.0
> +'
> +
>  test_expect_success 'multiple --points-at are OR-ed together' '
>  	cat >expect <<-\EOF &&
>  	v2.0

Mmm, I see part of my feedback on 1/3 is addressed here. IMO better just
to squash this into that, or at least say in the commit message "this
commit leaves us with a test blind spot for XYZ reason, but it will be
added back...".
diff mbox series

Patch

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 7a7c0ccee9..5297da952d 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1700,6 +1700,14 @@  test_expect_success '--points-at finds annotated tags of tags' '
 	test_cmp expect actual
 '
 
+test_expect_success 'recursive tagging should fail without --allow-recursive-tag' '
+	test_must_fail git tag -m recursive recursive annotated-v4.0
+'
+
+test_expect_success 'recursive tagging should pass with --allow-recursive-tag' '
+	git tag --allow-recursive-tag -m recursive recursive annotated-v4.0
+'
+
 test_expect_success 'multiple --points-at are OR-ed together' '
 	cat >expect <<-\EOF &&
 	v2.0