Re: [PATCH v3 6/6] remote rename/remove: gently handle remote.pushDefault config
On Wed, Jan 29, 2020 at 7:57 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 27 quoted lines
>
> 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.
Thanks. Will squash them and re-roll.
Bert
Show 80 quoted lines
>
> 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" &&