Skip to content

Commit a162e78

Browse files
moygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 34779c5 commit a162e78

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/t5701-clone-local.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,14 @@ test_expect_success 'clone empty repository' '
132132
test $actual = $expected)
133133
'
134134

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+
135145
test_done

0 commit comments

Comments
 (0)