aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2009-04-20 13:09:37 +0200
committerJunio C Hamano <gitster@pobox.com>2009-04-20 13:53:03 -0700
commita162e78df082d4f885bda2e51067d9788a7f65e4 (patch)
treeee799396b112a96dc2c47929c068a630ee329d02 /t
parent34779c535c4e121414197ab08b4b502a22a75433 (diff)
downloadgit-a162e78df082d4f885bda2e51067d9788a7f65e4.tar.gz
git-a162e78df082d4f885bda2e51067d9788a7f65e4.tar.xz
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t5701-clone-local.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh
index 3559d1796..f26b511c3 100755
--- a/t/t5701-clone-local.sh
+++ b/t/t5701-clone-local.sh
@@ -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