Subject: Re: [PATCH 2/2] add-patch: quit on EOF

From: Junio C Hamano <[email-masked]>
Date: Sat, 25 Oct 2025 17:46:55 -0700

René Scharfe <[email-masked]> writes:

> diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
> index 851ca6dd91..071b78c355 100755
> --- a/t/t3701-add-interactive.sh
> +++ b/t/t3701-add-interactive.sh
> @@ -1431,4 +1431,15 @@ test_expect_success 'invalid option s is rejected' '
>  	test_cmp expect actual
>  '
>  
> +test_expect_success 'EOF quits' '
> +	echo a >file &&
> +	echo a >file2 &&
> +	git add file file2 &&
> +	echo X >file &&
> +	echo X >file2 &&
> +	git add -p </dev/null >out &&
> +	grep file out &&
> +	! grep file2 out
> +'
> +
>  test_done

Let's do this squashed in.

 t/t3701-add-interactive.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git c/t/t3701-add-interactive.sh w/t/t3701-add-interactive.sh
index 071b78c355..4285314f35 100755
--- c/t/t3701-add-interactive.sh
+++ w/t/t3701-add-interactive.sh
@@ -1438,8 +1438,8 @@ test_expect_success 'EOF quits' '
 	echo X >file &&
 	echo X >file2 &&
 	git add -p </dev/null >out &&
-	grep file out &&
-	! grep file2 out
+	test_grep file out &&
+	test_grep ! file2 out
 '
 
 test_done