Re: [PATCH 8/8] t5801: teach compare_refs() to accept !
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 25, 2020, 06:31 UTC
- Message-ID
- <xmqqv9mtx7wv.fsf@gitster.c.googlers.com>
- In-Reply-To
- <b51f97f6ae37e4b69b9651cbd60a480e5db3e72d.1585115341.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 20 quoted lines
> compare_refs() {
> + fail= &&
> + if test "x$1" = 'x!'
> + then
> + fail='!' &&
> + shift
> + fi &&
> git --git-dir="$1/.git" rev-parse --verify $2 >expect &&
> git --git-dir="$3/.git" rev-parse --verify $4 >actual &&
> - test_cmp expect actual
> + eval $fail test_cmp expect actual
> }
>
> test_expect_success 'setup repository' '
> @@ -189,7 +195,7 @@ test_expect_success GPG 'push signed tag' '
> git push origin signed-tag
> ) &&
> compare_refs local signed-tag^{} server signed-tag^{} &&
> - test_must_fail compare_refs local signed-tag server signed-tag
> + compare_refs ! local signed-tag server signed-tagWhile this is not wrong per-se, I do not know why we cannot just use
! compare_refs local signed-tag server signed-tag
i.e. "we expect these two repositories have different tags"?
It is totally plausible that I am missing something obvious, as it is getting late and I no longer am a night person.
Thanks.
> ' > > test_expect_success GPG 'push signed tag with signed-tags capability' '