]> git.ipfire.org Git - thirdparty/git.git/commitdiff
clone: add test for push on an empty clone.
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Mon, 20 Apr 2009 11:09:37 +0000 (13:09 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Apr 2009 20:53:03 +0000 (13:53 -0700)
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>
t/t5701-clone-local.sh

index 3559d179647035a6ad8783aabfbecb8edcd4c254..f26b511c3ec7bf46f3fe9357cfdec9f95a169a14 100755 (executable)
@@ -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