]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'bc/clone-bare-with-conflicting-config'
authorJunio C Hamano <gitster@pobox.com>
Mon, 22 Mar 2021 21:00:25 +0000 (14:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Mar 2021 21:00:25 +0000 (14:00 -0700)
"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

1  2 
t/t5606-clone-options.sh

index 1da6ddb2c56cbf9890f57f8eac1bdc4118796013,88349343e8a6400603c8699c88edb1be669d9c45..428b0aac93fabd0b947294a9929dcab317fd72bd
@@@ -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' '