Skip to content

Commit

Permalink
clone: add test for push on an empty clone.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Apr 20, 2009
1 parent 34779c5 commit a162e78
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t/t5701-clone-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a162e78

Please sign in to comment.