Browse Source

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>
maint
Matthieu Moy 16 years ago committed by Junio C Hamano
parent
commit
a162e78df0
  1. 10
      t/t5701-clone-local.sh

10
t/t5701-clone-local.sh

@ -132,4 +132,14 @@ test_expect_success 'clone empty repository' ' @@ -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

Loading…
Cancel
Save