From: Junio C Hamano Date: Mon, 22 Mar 2021 21:00:25 +0000 (-0700) Subject: Merge branch 'bc/clone-bare-with-conflicting-config' X-Git-Tag: v2.32.0-rc0~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3099d4faa3ffb888cddb3b1fbba8f13a52f6726c;p=thirdparty%2Fgit.git Merge branch 'bc/clone-bare-with-conflicting-config' "git -c core.bare=false clone --bare ..." would have segfaulted, which has been corrected. * bc/clone-bare-with-conflicting-config: builtin/init-db: handle bare clones when core.bare set to false --- 3099d4faa3ffb888cddb3b1fbba8f13a52f6726c diff --cc t/t5606-clone-options.sh index 1da6ddb2c5,88349343e8..428b0aac93 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh @@@ -104,14 -101,20 +104,22 @@@ test_expect_success 'redirected clone - ' + test_expect_success 'clone does not segfault with --bare and core.bare=false' ' + test_config_global core.bare false && + git clone --bare parent clone-bare && + echo true >expect && + git -C clone-bare rev-parse --is-bare-repository >actual && + test_cmp expect actual + ' + test_expect_success 'chooses correct default initial branch name' ' - git init --bare empty && GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \ - git -c init.defaultBranch=up clone empty whats-up && - test refs/heads/up = $(git -C whats-up symbolic-ref HEAD) && - test refs/heads/up = $(git -C whats-up config branch.up.merge) + git -c init.defaultBranch=foo init --bare empty && + test_config -C empty lsrefs.unborn advertise && + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \ + git -c init.defaultBranch=up -c protocol.version=2 clone empty whats-up && + test refs/heads/foo = $(git -C whats-up symbolic-ref HEAD) && + test refs/heads/foo = $(git -C whats-up config branch.foo.merge) ' test_expect_success 'guesses initial branch name correctly' '