From: Junio C Hamano Date: Mon, 24 Aug 2015 17:31:41 GMT Subject: Re: [PATCH v3 7/8] branch.c: use 'ref-filter' APIs Message-ID: In-Reply-To: Karthik Nayak 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.