summaryrefslogtreecommitdiff
path: root/t/t5606-clone-options.sh
diff options
context:
space:
mode:
authorLibravatar Jonathan Tan <jonathantanmy@google.com>2021-02-05 12:48:49 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-02-05 13:49:55 -0800
commit4f37d45706514a4b3d0259d26f719678a0cf3521 (patch)
tree2b38899f23f3e5e88b72fba0f093e8fb76255089 /t/t5606-clone-options.sh
parentconnect, transport: encapsulate arg in struct (diff)
downloadtgif-4f37d45706514a4b3d0259d26f719678a0cf3521.tar.xz
clone: respect remote unborn HEAD
Teach Git to use the "unborn" feature introduced in a previous patch as follows: Git will always send the "unborn" argument if it is supported by the server. During "git clone", if cloning an empty repository, Git will use the new information to determine the local branch to create. In all other cases, Git will ignore it. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5606-clone-options.sh')
-rwxr-xr-xt/t5606-clone-options.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 7f082fb23b..ca6339a5fb 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -102,11 +102,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' '