Karthik Nayak <karthik....@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.



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to