git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Matthew Rogers <mattr94@gmail.com>
Subject: Re: [PATCH v3 6/6] remote rename/remove: gently handle remote.pushDefault config
Date: Tue, 28 Jan 2020 22:57:16 -0800	[thread overview]
Message-ID: <xmqqv9ou6983.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <965b587f5834c88532476b56da95ead605d16000.1580110970.git.bert.wesarg@googlemail.com> (Bert Wesarg's message of "Mon, 27 Jan 2020 09:15:54 +0100")

Bert Wesarg <bert.wesarg@googlemail.com> writes:

> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> index 082042b05a..bbff8c5770 100755
> --- a/t/t5505-remote.sh
> +++ b/t/t5505-remote.sh
> @@ -737,6 +737,7 @@ test_expect_success 'rename a remote' '
>  	git clone one four &&
>  	(
>  		cd four &&
> +		test_config_global remote.pushDefault origin &&
>  		git config branch.master.pushRemote origin &&
>  		git remote rename origin upstream &&
>  		test -z "$(git for-each-ref refs/remotes/origin)" &&

You cannot use test_config and test_config_global inside a subshell,
as they rely on test_when_finished to rewind their effect, which
cannot be used inside a subshell.  As you are doing "global" config,
there is no reason to make "git config --global" call in a particular
repository anyway, so just do this upfront as the first thing in the
test sequence.  There are a few others in this file.

Tentatively I applied the following fix-up on top of the series to
unblock tonight's integration cycle.

Thanks.

 t/t5505-remote.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index bbff8c5770..dda81b7d07 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -734,10 +734,10 @@ test_expect_success 'reject adding remote with an invalid name' '
 # the last two ones check if the config is updated.
 
 test_expect_success 'rename a remote' '
+	test_config_global remote.pushDefault origin &&
 	git clone one four &&
 	(
 		cd four &&
-		test_config_global remote.pushDefault origin &&
 		git config branch.master.pushRemote origin &&
 		git remote rename origin upstream &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
@@ -761,10 +761,10 @@ test_expect_success 'rename a remote renames repo remote.pushDefault' '
 '
 
 test_expect_success 'rename a remote renames repo remote.pushDefault but ignores global' '
+	test_config_global remote.pushDefault other &&
 	git clone one four.2 &&
 	(
 		cd four.2 &&
-		test_config_global remote.pushDefault other &&
 		git config remote.pushDefault origin &&
 		git remote rename origin upstream &&
 		test "$(git config --global remote.pushDefault)" = "other" &&
@@ -773,10 +773,10 @@ test_expect_success 'rename a remote renames repo remote.pushDefault but ignores
 '
 
 test_expect_success 'rename a remote renames repo remote.pushDefault but keeps global' '
+	test_config_global remote.pushDefault origin &&
 	git clone one four.3 &&
 	(
 		cd four.3 &&
-		test_config_global remote.pushDefault origin &&
 		git config remote.pushDefault origin &&
 		git remote rename origin upstream &&
 		test "$(git config --global remote.pushDefault)" = "origin" &&
@@ -823,10 +823,10 @@ test_expect_success 'rename succeeds with existing remote.<target>.prune' '
 '
 
 test_expect_success 'remove a remote' '
+	test_config_global remote.pushDefault origin &&
 	git clone one four.five &&
 	(
 		cd four.five &&
-		test_config_global remote.pushDefault origin &&
 		git config branch.master.pushRemote origin &&
 		git remote remove origin &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
@@ -847,10 +847,10 @@ test_expect_success 'remove a remote removes repo remote.pushDefault' '
 '
 
 test_expect_success 'remove a remote removes repo remote.pushDefault but ignores global' '
+	test_config_global remote.pushDefault other &&
 	git clone one four.five.2 &&
 	(
 		cd four.five.2 &&
-		test_config_global remote.pushDefault other &&
 		git config remote.pushDefault origin &&
 		git remote remove origin &&
 		test "$(git config --global remote.pushDefault)" = "other" &&
@@ -859,10 +859,10 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but ignores
 '
 
 test_expect_success 'remove a remote removes repo remote.pushDefault but keeps global' '
+	test_config_global remote.pushDefault origin &&
 	git clone one four.five.3 &&
 	(
 		cd four.five.3 &&
-		test_config_global remote.pushDefault origin &&
 		git config remote.pushDefault origin &&
 		git remote remove origin &&
 		test "$(git config --global remote.pushDefault)" = "origin" &&

  reply	other threads:[~2020-01-29  6:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27  7:04 [PATCH v3 0/7] remote rename/remove: improve handling of configuration values Bert Wesarg
2020-01-27  7:04 ` [PATCH 1/6] pull --rebase/remote rename: document and honor single-letter abbreviations rebase types Bert Wesarg
2020-01-27  7:04 ` [PATCH v2 2/6] remote: clean-up by returning early to avoid one indentation Bert Wesarg
2020-01-27  7:04 ` [PATCH 3/6] remote: clean-up config callback Bert Wesarg
2020-01-27  7:04 ` [PATCH v4 4/6] remote rename/remove: handle branch.<name>.pushRemote config values Bert Wesarg
2020-01-27  7:04 ` [PATCH 5/6] config: provide access to the current line number Bert Wesarg
2020-01-27  7:04 ` [PATCH v2 6/6] remote rename/remove: gently handle remote.pushDefault config Bert Wesarg
2020-01-27  8:15   ` [PATCH v3 " Bert Wesarg
2020-01-29  6:57     ` Junio C Hamano [this message]
2020-01-29  9:16       ` Bert Wesarg

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=xmqqv9ou6983.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=mattr94@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).