Subject: Re: [PATCH v4 3/3] t4113: put executable lines to test_expect_success

From: Junio C Hamano <[email-masked]>
Date: Mon, 06 Feb 2023 14:44:26 -0800

Shuqi Liang <[email-masked]> writes:

> -cat >test-patch <<\EOF
> -diff --git a/file b/file
> ---- a/file
> -+++ b/file
> -@@ -1,2 +1,3 @@
> - a
> - b
> -+c
> -EOF
> -
> -echo 'a' >file
> -echo 'b' >>file
> -echo 'c' >>file

Have you run the resulting test?

>  test_expect_success setup '
> +	cat >test-patch <<-\EOF
> +	diff --git a/file b/file
> +	--- a/file
> +	+++ b/file
> +	@@ -1,2 +1,3 @@
> +	a
> +	b
> +	+c
> +	EOF

This creates a "test-patch" file with lines 'a' and 'b' that are
common context lines without any whitespace before them, no?  The
original left the necessary single space in front of them (see the
line removed above).