[PATCH] clone: add test for push on an empty clone.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 t/t5701-clone-local.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh
index 3559d17..f26b511 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
-- 
1.6.2.2.449.g92961.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]