public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: David Tran <unsignedzero@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] tests: set temp variables using 'env' in test function instead of subshell
Date: Mon, 17 Mar 2014 13:57:54 -0700	[thread overview]
Message-ID: <xmqqeh20czl9.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1395046593-4057-1-git-send-email-unsignedzero@gmail.com> (David Tran's message of "Mon, 17 Mar 2014 08:56:33 +0000")

David Tran <unsignedzero@gmail•com> writes:

> Fixed the broken &&-chain and the tests run correctly. The double env is
> fixed to be a single env. The useless subshells are removed.
> ...

Hmph.

>  test_expect_success 'need valid notes ref' '
> -	(MSG=1 GIT_NOTES_REF=/ && export MSG GIT_NOTES_REF &&
> -	 test_must_fail git notes add) &&
> -	(MSG=2 GIT_NOTES_REF=/ && export MSG GIT_NOTES_REF &&
> -	 test_must_fail git notes show)
> +	test_must_fail env MSG=1 env GIT_NOTES_REF=/ git notes show &&
> +	test_must_fail env MSG=2 env GIT_NOTES_REF=/ git notes show
>  '

Oh, really ;-)?

>  test_expect_success 'refusing to add notes in refs/heads/' '
> -	(MSG=1 GIT_NOTES_REF=refs/heads/bogus &&
> -	 export MSG GIT_NOTES_REF &&
> -	 test_must_fail git notes add)
> +	test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add
>  '

This one is good.

> @@ -529,9 +510,7 @@ test_expect_success 'aborted --continue does not squash commits after "edit"' '
>  	echo "edited again" > file7 &&
>  	git add file7 &&
>  	(
> -		FAKE_COMMIT_MESSAGE=" " &&
> -		export FAKE_COMMIT_MESSAGE &&
> -		test_must_fail git rebase --continue
> +		test_must_fail env FAKE_COMMIT_MESSAGE=" " git rebase --continue
>  	) &&

Do we do anything to cause us misbehave if the above is done outside
the subshell?

Thanks.  Getting closer, I think.

      reply	other threads:[~2014-03-17 20:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <244240>
2014-03-17  8:56 ` [PATCH] tests: set temp variables using 'env' in test function instead of subshell David Tran
2014-03-17 20:57   ` Junio C Hamano [this message]

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=xmqqeh20czl9.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=unsignedzero@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox