Re: [PATCH 3/4] Clean: Remove unnecessary `\' (line continuation)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 30, 2011, 19:21 UTC
- Message-ID
- <7v8vvwo1n2.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <a59d19d0-f279-43fe-8ac6-06c4bd13c941-mfwitten@gmail.com>
Michael Witten <mfwitten@gmail.com> writes:
Show 16 quoted lines
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
> t/t8001-annotate.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
> index 45cb60e..68ac828 100755
> --- a/t/t8001-annotate.sh
> +++ b/t/t8001-annotate.sh
> @@ -8,7 +8,7 @@ PROG='git annotate'
>
> test_expect_success \
> 'Annotating an old revision works' \
> - '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") -eq 2 ] && \
> + '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") -eq 2 ] &&
> [ $(git annotate file master | awk "{print \$3}" | grep -c "^B$") -eq 2 ]'While this is not wrong per-se, I don't want to take too much half-way churning.
If we were to properly do this, we should first rewrite it to use the more modern style:
test_expect_success 'Annotating an old revision works' '
... test script comes here ...
'and just run annotate once without having any downstream pipe, i.e.
git annotate file master >result &&
awk "{ print \$3; }" <result >authors &&
test 2 = $(grep A <authors | wc -l) &&
test 2 = $(grep B <authors | wc -l)so that we can catch breakage in "git annotate" itself more reliably (e.g. even if the command showed two lines for each author, it is a failure if the command itself did not exit with status 0).