Re: [PATCH 09/18] t3404: Test the commit count in commit messages generated by "rebase -i"
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Jan 14, 2010, 08:59 UTC
- Message-ID
- <4B4EDD02.70603@alum.mit.edu>
- In-Reply-To
- <4B4ECB76.3030009@viscovery.net>
Johannes Sixt wrote:
Show 7 quoted lines
> Michael Haggerty schrieb: >> + test -z "$EXPECT_HEADER_COUNT" || >> + test "$EXPECT_HEADER_COUNT" = $(sed -n '1s/^# This is a combination of \(.*\) commits\./\1/p' < "$1") || >> + exit > > Is an empty $EXPECT_HEADER_COUNT an error? I suppose it isn't; therefore, > you must put the second 'test' and the 'exit' in a brace group.
True, an empty $EXPECT_HEADER_COUNT is not an error. But I think the form (A || B || C) is correct anyway, because if $EXPECT_HEADER_COUNT is empty, then A is successful, and neither B nor C are executed, and execution falls through to the later tests.
> You should also put the $(sed) in double-quotes.
Yes, thanks. I'll include it in the next version.
Michael