diff --git a/builtin/remote.c b/builtin/remote.c index f286ae9753..717b662d45 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 ffd821c00e..421ac8629b 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -754,6 +754,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)" && @@ -770,6 +771,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" ) '