summaryrefslogtreecommitdiff
path: root/t/t5606-clone-options.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5606-clone-options.sh')
-rwxr-xr-xt/t5606-clone-options.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 7f082fb..52e5789 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -1,6 +1,9 @@
#!/bin/sh
test_description='basic clone options'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success 'setup' '
@@ -15,7 +18,7 @@ test_expect_success 'setup' '
test_expect_success 'clone -o' '
git clone -o foo parent clone-o &&
- git -C clone-o rev-parse --verify refs/remotes/foo/master
+ git -C clone-o rev-parse --verify refs/remotes/foo/main
'
@@ -45,7 +48,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
test_expect_success 'uses "origin" for default remote name' '
git clone parent clone-default-origin &&
- git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
+ git -C clone-default-origin rev-parse --verify refs/remotes/origin/main
'
@@ -74,14 +77,14 @@ test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
test_config_global clone.defaultRemoteName from_config &&
git clone parent clone-config-origin &&
- git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
+ git -C clone-config-origin rev-parse --verify refs/remotes/from_config/main
'
test_expect_success 'prefers --origin over -c config' '
git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
- git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
+ git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/main
'
@@ -102,11 +105,13 @@ test_expect_success 'redirected clone -v does show progress' '
'
test_expect_success 'chooses correct default initial branch name' '
- git init --bare empty &&
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
+ 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 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)
+ 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' '