Install the default "master" branch configuration after cloning a void

After "cloning from an empty repository", we have a configuration to
describe the remote's URL and the default ref mappings, but we lack the
branch configuration for the default branch we create on our end,
"master".

It is likely that the empty repository we cloned from will point the
default "master" branch with its HEAD, so prepare the local configuration
to match.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2009-02-11 22:42:27 -08:00
parent 1a526d4838
commit 5cd12b85fe
2 changed files with 33 additions and 5 deletions

View File

@ -144,4 +144,19 @@ test_expect_success 'clone to an existing path' '
test_must_fail git clone src target-5
'
test_expect_success 'clone a void' '
mkdir src-0 &&
(
cd src-0 && git init
) &&
git clone src-0 target-6 &&
(
cd src-0 && test_commit A
) &&
git clone src-0 target-7 &&
# There is no reason to insist they are bit-for-bit
# identical, but this test should suffice for now.
test_cmp target-6/.git/config target-7/.git/config
'
test_done