diff mbox series

[v3,1/8] merge tests: don't ignore "rev-parse" exit code in helper

Message ID patch-v3-1.8-64dfec31fb3-20221202T114733Z-avarab@gmail.com (mailing list archive)
State Superseded
Commit 4d81ce1b99b9e73e1f75fe4783ecff08a8ad736e
Headers show
Series tests: fix ignored & hidden exit codes | expand

Commit Message

Ævar Arnfjörð Bjarmason Dec. 2, 2022, 11:52 a.m. UTC
Change the verify_mergeheads() helper the check the exit code of "git
rev-parse".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7600-merge.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Dec. 5, 2022, 12:24 a.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Subject: Re: [PATCH v3 1/8] merge tests: don't ignore "rev-parse" exit code in helper

Just one is inclded here, so I'll retitle (and I am tempted to
disassemble the "series" into separate individual topics, as that
will help to use good bits early without getting distracted by the
rest) this to something like "s/^[^:]*:/t7600:/"

> Change the verify_mergeheads() helper the check the exit code of "git
> rev-parse".
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  t/t7600-merge.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks.

>
> diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
> index 7c3f6ed9943..060e145957f 100755
> --- a/t/t7600-merge.sh
> +++ b/t/t7600-merge.sh
> @@ -105,7 +105,7 @@ verify_mergeheads () {
>  	test_write_lines "$@" >mergehead.expected &&
>  	while read sha1 rest
>  	do
> -		git rev-parse $sha1
> +		git rev-parse $sha1 || return 1
>  	done <.git/MERGE_HEAD >mergehead.actual &&
>  	test_cmp mergehead.expected mergehead.actual
>  }
diff mbox series

Patch

diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 7c3f6ed9943..060e145957f 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -105,7 +105,7 @@  verify_mergeheads () {
 	test_write_lines "$@" >mergehead.expected &&
 	while read sha1 rest
 	do
-		git rev-parse $sha1
+		git rev-parse $sha1 || return 1
 	done <.git/MERGE_HEAD >mergehead.actual &&
 	test_cmp mergehead.expected mergehead.actual
 }