get_local_heads(): do not return random pointer if there is no head
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 16 Apr 2009 22:16:23 +0000 (08:16 +1000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 18 Apr 2009 03:48:32 +0000 (20:48 -0700)
commit55f0566f6d7269a56751333e0943b50237ce6a85
tree882e7400a1e085b19d31761d0066f515796acf60
parentf800b65bea1504299747e7be03ee279508a74e1f
get_local_heads(): do not return random pointer if there is no head

it's silly to do this:

mkdir foo && cd foo && git init && git push somewhere.git

but segfault should not happen even in that case.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c