git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] remote: write camel-cased *.pushRemote on rename
Date: Thu, 18 Mar 2021 12:22:36 +0100	[thread overview]
Message-ID: <CAKPyHN33Aj63FuSMPJfz6W3F6EUt6ZLZzWaYS5puiKa13uHctw@mail.gmail.com> (raw)
In-Reply-To: <20210225012117.17331-2-avarab@gmail.com>

On Thu, Feb 25, 2021 at 2:21 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> When a remote is renamed don't change the canonical "*.pushRemote"
> form to "*.pushremote". Fixes and tests for a minor bug in
> 923d4a5ca4f (remote rename/remove: handle branch.<name>.pushRemote
> config values, 2020-01-27). See the preceding commit for why this does
> & doesn't matter.
>
> While we're at it let's also test that we handle the "*.pushDefault"
> key correctly. The code to handle that was added in
> b3fd6cbf294 (remote rename/remove: gently handle remote.pushDefault
> config, 2020-02-01) and does the right thing, but nothing tested that
> we wrote out the canonical camel-cased form.
>

Fine with me.

Thanks.

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/remote.c  | 2 +-
>  t/t5505-remote.sh | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/remote.c b/builtin/remote.c
> index f286ae97538..717b662d455 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -746,7 +746,7 @@ static int mv(int argc, const char **argv)
>                 }
>                 if (info->push_remote_name && !strcmp(info->push_remote_name, rename.old_name)) {
>                         strbuf_reset(&buf);
> -                       strbuf_addf(&buf, "branch.%s.pushremote", item->string);
> +                       strbuf_addf(&buf, "branch.%s.pushRemote", item->string);
>                         git_config_set(buf.buf, rename.new_name);
>                 }
>         }
> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> index 2a7b5cd00a0..34fc3fa421f 100755
> --- a/t/t5505-remote.sh
> +++ b/t/t5505-remote.sh
> @@ -757,6 +757,7 @@ test_expect_success 'rename a remote' '
>                 cd four &&
>                 git config branch.main.pushRemote origin &&
>                 git remote rename origin upstream &&
> +               grep "pushRemote" .git/config &&
>                 test -z "$(git for-each-ref refs/remotes/origin)" &&
>                 test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
>                 test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
> @@ -773,6 +774,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault' '
>                 cd four.1 &&
>                 git config remote.pushDefault origin &&
>                 git remote rename origin upstream &&
> +               grep pushDefault .git/config &&
>                 test "$(git config --local remote.pushDefault)" = "upstream"
>         )
>  '
> --
> 2.30.0.284.gd98b1dd5eaa7
>

  parent reply	other threads:[~2021-03-18 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  1:21 [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Ævar Arnfjörð Bjarmason
2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
2021-02-25  3:17   ` Junio C Hamano
2021-03-18 11:22   ` Bert Wesarg [this message]
2021-02-25  3:02 ` [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Junio C Hamano
2021-02-25  3:16 ` Junio C Hamano
2021-02-25 19:47   ` Ævar Arnfjörð Bjarmason
2021-02-25 20:00     ` Junio C Hamano

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=CAKPyHN33Aj63FuSMPJfz6W3F6EUt6ZLZzWaYS5puiKa13uHctw@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).