summaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-02-25 01:21:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-25 03:03:00 (GMT)
commit0f1da600e6864e8b4fe97aea72a3b68c227a709c (patch)
treeccd9d67c0a97f4fb6b1b5350dd8c8e7186656c86 /t/t5505-remote.sh
parentbfa9148ff7df2ee5213c6467e3410ba134591178 (diff)
downloadgit-0f1da600e6864e8b4fe97aea72a3b68c227a709c.zip
git-0f1da600e6864e8b4fe97aea72a3b68c227a709c.tar.gz
git-0f1da600e6864e8b4fe97aea72a3b68c227a709c.tar.bz2
remote: write camel-cased *.pushRemote on rename
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. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index ffd821c..421ac86 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"
)
'