Re: [PATCH v3 5/8] push: add an advice on unqualified <dst> push
- From
Jeff King <peff@peff.net>
- Date
- Nov 2, 2018, 06:47 UTC
- Message-ID
- <20181102064751.GJ31216@sigill.intra.peff.net>
- In-Reply-To
- <xmqqva5l49np.fsf@gitster-ct.c.googlers.com>
On Mon, Oct 29, 2018 at 02:14:02PM +0900, Junio C Hamano wrote:
Show 22 quoted lines
> Any failure in the &&-chain (or the last grep) would not terminate > the for loop, so for the purpose of determining the success of this > test_expect_success, the last "blob" iteration is the only thing > that matters. > > Which is probably not what you want. If testing all of these is > important, then you can do this: > > ( > exit_with=true && > for type in ... > do > ... many ... && > ... many ... && > ... tests ... || > exit_with=false > done > $exit_with > ) > > or just say "|| exit" and leave the loop (and the subprocess running > it) early on the first failure.
You can skip the subshell and just "|| return 1" from the chain inside the loop. We run the test snippets inside an extra layer of function-call exactly to allow that.
-Peff