Subject: Re: [PATCH v4 29/36] hook tests: use a modern style for "pre-push" tests

From: Emily Shaffer <[email-masked]>
Date: Thu, 19 Aug 2021 17:18:55 -0700

On Tue, Aug 03, 2021 at 09:38:55PM +0200, Ævar Arnfjörð Bjarmason wrote:
> 
> Indent the here-docs and use "test_cmp" instead of "diff" in tests
> added in ec55559f937 (push: Add support for pre-push hooks,
> 2013-01-13). Let's also use the more typical "expect" instead of
> "expected" to be consistent with the rest of the test file.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <[email-masked]>
> ---
>  t/t5571-pre-push-hook.sh | 71 ++++++++++++++++++++--------------------
>  1 file changed, 35 insertions(+), 36 deletions(-)
> 
> diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
> index d2857a6fbc0..6d0d5b854ea 100755
> --- a/t/t5571-pre-push-hook.sh
> +++ b/t/t5571-pre-push-hook.sh
> @@ -61,15 +61,15 @@ echo "$2" >>actual
>  cat >>actual
>  EOF
>  
> -cat >expected <<EOF
> -parent1
> -repo1
> -refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
> -EOF
> -
>  test_expect_success 'push with hook' '
> +	cat >expected <<-EOF &&
> +	parent1
> +	repo1
> +	refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
> +	EOF
> +
>  	git push parent1 main:foreign &&
> -	diff expected actual
> +	test_cmp expected actual

Your commit message tells me you're getting rid of 'expected', but here
it is. Should that just be 'expect'?

Otherwise it looks fine.

Reviewed-by: Emily Shaffer <[email-masked]>