Re: [PATCH 03/11] t3407: use test_cmp_rev
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Sep 8, 2021, 13:42 UTC
- Message-ID
- <e347691c-9f5e-9103-8690-014aa0054717@gmail.com>
- In-Reply-To
- <87ilzbic3l.fsf@evledraar.gmail.com>
On 08/09/2021 11:40, Ævar Arnfjörð Bjarmason wrote:
Show 14 quoted lines
>
> On Wed, Sep 08 2021, Phillip Wood via GitGitGadget wrote:
>
>> @@ -54,9 +54,9 @@ testrebase() {
>> echo d >> a &&
>> git add a &&
>> test_must_fail git rebase --continue &&
>> - test $(git rev-parse HEAD) != $(git rev-parse main) &&
>> + ! test_cmp_rev HEAD main &&
>
> Use "test_cmp_rev !", making the shell do the negation is troublesome
> for the same reason we don't do it with git command, it potentially
> hides segfaults (and that test helper invokes "git", hence the optional
> "!" first argument).Thanks, I didn't realize one could pass "!" to test_cmp_rev - it gives a better message on failure as well as avoiding hidden segfaults
Best Wishes
Phillip