diff mbox series

[2/2] t3301: test proper exit response to no-value notes.displayRef.

Message ID 20201123032342.24566-3-nate@roosteregg.cc (mailing list archive)
State Accepted
Commit 45fef1599af19404a7d0d80a985b303d665ef4a3
Headers show
Series Fix a segfault in git log --notes | expand

Commit Message

nate@roosteregg.cc Nov. 23, 2020, 3:23 a.m. UTC
From: Nate Avers <nate@roosteregg.cc>

Signed-off-by: Nate Avers <nate@roosteregg.cc>
---
 t/t3301-notes.sh | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Junio C Hamano Nov. 23, 2020, 6:44 p.m. UTC | #1
nate@roosteregg.cc writes:

> From: Nate Avers <nate@roosteregg.cc>
>
> Signed-off-by: Nate Avers <nate@roosteregg.cc>
> ---
>  t/t3301-notes.sh | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
> index 8f43303007..ca60faf480 100755
> --- a/t/t3301-notes.sh
> +++ b/t/t3301-notes.sh
> @@ -672,6 +672,11 @@ test_expect_success 'notes.displayRef respects order' '
>  	test_cmp expect-both-reversed actual
>  '
>  
> +test_expect_success 'notes.displayRef with no value handled gracefully' '
> +	test_must_fail git -c notes.displayRef log -0 --notes &&
> +	test_must_fail git -c notes.displayRef diff-tree --notes HEAD
> +'

Looks good.  I didn't know we can feed the "no assignment means
true" configuration from the command line with "git -c" ;-)

>  test_expect_success 'GIT_NOTES_DISPLAY_REF works' '
>  	GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \
>  		git log -2 >actual &&
diff mbox series

Patch

diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 8f43303007..ca60faf480 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -672,6 +672,11 @@  test_expect_success 'notes.displayRef respects order' '
 	test_cmp expect-both-reversed actual
 '
 
+test_expect_success 'notes.displayRef with no value handled gracefully' '
+	test_must_fail git -c notes.displayRef log -0 --notes &&
+	test_must_fail git -c notes.displayRef diff-tree --notes HEAD
+'
+
 test_expect_success 'GIT_NOTES_DISPLAY_REF works' '
 	GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \
 		git log -2 >actual &&