Re: [PATCH v3 7/8] branch.c: use 'ref-filter' APIs
On Mon, Aug 24, 2015 at 11:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>>>> test_expect_success 'git branch shows badly named ref' '
>>>> cp .git/refs/heads/master .git/refs/heads/broken...ref &&
>>>> test_when_finished "rm -f .git/refs/heads/broken...ref" &&
>>>> - git branch >output &&
>>>> + git branch 2>output &&
>>>> grep -e "broken\.\.\.ref" output
>>>> '
>>>
>>> Maybe the test could be renamed to 'git branch warns about badly named
>>> ref' and maybe you could also check that "broken\.\.\.ref" is not
>>> printed on stdout.
>>
>> The name change sounds reasonable, do we really need to check for it in the
>> stdout?
>
> I think Christian meant "we should check in both", i.e.
>
> git branch >output 2>error &&
> grep "broken\.\.\.ref" error &&
> ! grep "broken\.\.\.ref" output
>
> or something like that. That way, you are effectively specifying in
> the test that badly named refs must not be included in the output,
> so somebody who changes that in the future needs to justify why
> including them in the output is a good idea when updating the test.
>
Ah! okay, I get what you're saying. Should I reroll it? Or a squash in?
--
Regards,
Karthik Nayak