clone: add test for push on an empty clone.

Commit 55f0566 (get_local_heads(): do not return random pointer if
there is no head, 2009-04-17) fixed a segfault for git push, this
patch adds a test-case to avoid future regressions.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Matthieu Moy 2009-04-20 13:09:37 +02:00 committed by Junio C Hamano
parent 34779c535c
commit a162e78df0

View file

@ -132,4 +132,14 @@ test_expect_success 'clone empty repository' '
test $actual = $expected)
'
test_expect_success 'clone empty repository, and then push should not segfault.' '
cd "$D" &&
rm -fr empty/ empty-clone/ &&
mkdir empty &&
(cd empty && git init) &&
git clone empty empty-clone &&
cd empty-clone &&
test_must_fail git push
'
test_done