From: Junio C Hamano Date: Mon, 27 Oct 2014 17:38:15 GMT Subject: Re: difftool--helper: exit when reading a prompt answer fails Message-ID: In-Reply-To: <20141027004148.GB81127@gmail.com> David Aguilar writes: >> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh >> index dc30a51..9cf5dc9 100755 >> --- a/t/t7800-difftool.sh >> +++ b/t/t7800-difftool.sh >> @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' ' >> ! grep br2 output >> ' >> >> +test_expect_success PERL 'ending prompt input with EOF' ' >> + git difftool -x cat branch output && >> + ! grep master output && >> + ! grep branch output && >> + ! grep m2 output && >> + ! grep br2 output >> +' > > Should we use "test_must_fail grep ..." instead of "! grep ..." here? NO. We do not expect system-supplied "grep" to dump core and declare it as a test failure. test_must_fail is for catching an expected non-zero status exit from git commands, i.e. when we expect our binary to correctly notice some condition and report that fact with non-zero exit status, we do not want to mistake the binary segfaulting as working correctly.