All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Aguilar <davvid@gmail.com>
Cc: git@vger.kernel.org, Fabian Ruch <bafain@gmail.com>
Subject: Re: [PATCH v3 2/3] t1503: use test_must_be_empty
Date: Mon, 15 Sep 2014 15:33:56 -0700	[thread overview]
Message-ID: <xmqqfvfs4ip7.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1410808059-1459-2-git-send-email-davvid@gmail.com> (David Aguilar's message of "Mon, 15 Sep 2014 12:07:38 -0700")

David Aguilar <davvid@gmail.com> writes:

> Use `test_must_be_be_empty <file>` instead of `test -z "$(cat <file>)"`.
>
> Suggested-by: Fabian Ruch <bafain@gmail.com>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
> Unchanged since last time, but rebased for the change in the
> previous patch.

It probably makes more sense to have this at the beginning of a
series as preliminary clean-up.  That way, the more interesting
change does not have to have "test -z $(cat ...)" that makes readers
go "Huh?".



>
>  t/t1503-rev-parse-verify.sh | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
> index fd9d0c3..4fe9f0e 100755
> --- a/t/t1503-rev-parse-verify.sh
> +++ b/t/t1503-rev-parse-verify.sh
> @@ -72,15 +72,15 @@ test_expect_success 'fails with any bad rev or many good revs' '
>  
>  test_expect_success 'fails silently when using -q' '
>  	test_must_fail git rev-parse --verify --quiet 2>error &&
> -	test -z "$(cat error)" &&
> +	test_must_be_empty error &&
>  	test_must_fail git rev-parse -q --verify foo 2>error &&
> -	test -z "$(cat error)" &&
> +	test_must_be_empty error &&
>  	test_must_fail git rev-parse --verify -q HEAD bar 2>error &&
> -	test -z "$(cat error)" &&
> +	test_must_be_empty error &&
>  	test_must_fail git rev-parse --quiet --verify baz HEAD 2>error &&
> -	test -z "$(cat error)" &&
> +	test_must_be_empty error &&
>  	test_must_fail git rev-parse -q --verify $HASH2 HEAD 2>error &&
> -	test -z "$(cat error)"
> +	test_must_be_empty error
>  '
>  
>  test_expect_success 'fails silently when using -q with deleted reflogs' '
> @@ -89,7 +89,7 @@ test_expect_success 'fails silently when using -q with deleted reflogs' '
>  	git update-ref -m "reflog message for refs/test" refs/test "$ref" &&
>  	git reflog delete --updateref --rewrite refs/test@{0} &&
>  	test_must_fail git rev-parse -q --verify refs/test@{0} >error 2>&1 &&
> -	test -z "$(cat error)"
> +	test_must_be_empty error
>  '
>  
>  test_expect_success 'no stdout output on error' '

  parent reply	other threads:[~2014-09-15 22:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 19:07 [PATCH v3 1/3] t1503: test rev-parse --verify --quiet with deleted reflogs David Aguilar
2014-09-15 19:07 ` [PATCH v3 2/3] t1503: use test_must_be_empty David Aguilar
2014-09-15 19:07   ` [PATCH v3 3/3] Documentation: a note about stdout for git rev-parse --verify --quiet David Aguilar
2014-09-15 22:34     ` Junio C Hamano
2014-09-15 22:33   ` Junio C Hamano [this message]
2014-09-15 22:32 ` [PATCH v3 1/3] t1503: test rev-parse --verify --quiet with deleted reflogs Junio C Hamano
2014-09-16  3:06   ` David Aguilar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfvfs4ip7.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=bafain@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.