@matheusbsbs / matheus-bagliano / commits / a162e78df0
Fork 0

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>

Matthieu Moy committed Apr 20, 2009 at 13:09 UTC a162e78df082d4f885bda2e51067d9788a7f65e4
1 file changed +10
t/t5701-clone-local.sh
+10
@@ -132,4 +132,14 @@ test_expect_success 'clone empty repository' '
132 test $actual = $expected)
133 '
134
135 +test_expect_success 'clone empty repository, and then push should not segfault.' '
136 + cd "$D" &&
137 + rm -fr empty/ empty-clone/ &&
138 + mkdir empty &&
139 + (cd empty && git init) &&
140 + git clone empty empty-clone &&
141 + cd empty-clone &&
142 + test_must_fail git push
143 +'
144 +
145 test_done