]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5606-clone-options.sh
Merge branch 'bc/clone-bare-with-conflicting-config'
[thirdparty/git.git] / t / t5606-clone-options.sh
index 5d6e63a841f7f2f64a0fa857261264c4bd924c67..428b0aac93fabd0b947294a9929dcab317fd72bd 100755 (executable)
@@ -104,12 +104,22 @@ test_expect_success 'redirected clone -v does show progress' '
 
 '
 
+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' '