summaryrefslogtreecommitdiff
path: root/t/t5702-protocol-v2.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-04 04:49:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-04 04:49:17 (GMT)
commitac162a606b673e44cec602dfe259aae8e5e08554 (patch)
treeeab7097e463ed367b554a47fe8f173547c33ac8d /t/t5702-protocol-v2.sh
parent4a6fd7d3c7d135f7be43c3ecc534c4487b21c1ec (diff)
parent6b58df54cf0f461abb35bb2fac407d2547dbc2f0 (diff)
downloadgit-ac162a606b673e44cec602dfe259aae8e5e08554.zip
git-ac162a606b673e44cec602dfe259aae8e5e08554.tar.gz
git-ac162a606b673e44cec602dfe259aae8e5e08554.tar.bz2
Merge branch 'jk/clone-unborn-head-in-bare'
"git clone" from a repository whose HEAD is unborn into a bare repository didn't follow the branch name the other side used, which is corrected. * jk/clone-unborn-head-in-bare: clone: handle unborn branch in bare repos
Diffstat (limited to 't/t5702-protocol-v2.sh')
-rwxr-xr-xt/t5702-protocol-v2.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index d3687b1..d527cf6 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -237,6 +237,19 @@ test_expect_success '...but not if explicitly forbidden by config' '
! grep "refs/heads/mydefaultbranch" file_empty_child/.git/HEAD
'
+test_expect_success 'bare clone propagates empty default branch' '
+ test_when_finished "rm -rf file_empty_parent file_empty_child.git" &&
+
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
+ git -c init.defaultBranch=mydefaultbranch init file_empty_parent &&
+
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
+ git -c init.defaultBranch=main -c protocol.version=2 \
+ clone --bare \
+ "file://$(pwd)/file_empty_parent" file_empty_child.git &&
+ grep "refs/heads/mydefaultbranch" file_empty_child.git/HEAD
+'
+
test_expect_success 'fetch with file:// using protocol v2' '
test_when_finished "rm -f log" &&