Re: [PATCH 2/2] t3650: add more regression tests for failure conditions
On Tue, Dec 23, 2025, at 11:58, Phillip Wood wrote:
Show 11 quoted lines
>>[snip]
>> +test_expect_success 'option --onto or --advance is mandatory' '
>> + cat >expect <<-\EOF &&
>> + error: option --onto or --advance is mandatory
>> + EOF
>> + # First line is the error; rest is Usage
>> + test_must_fail git replay topic1..topic2 >&1 2>&1 |
>> + head -1 >actual &&
>
> Using a pipe means we lose the return value of test_must_fail here so
> the test wont fail if the command succeeds. Everything else looks good
Thanks. That’s kind of subtle for me. I’ll fix.
I’ll just test for the full output instead of the first line.