All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] get_local_heads(): do not return random pointer if there is no head
@ 2009-04-16 22:16 Nguyễn Thái Ngọc Duy
  2009-04-18  5:02 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2009-04-16 22:16 UTC (permalink / raw
  To: git; +Cc: Nguyễn Thái Ngọc Duy

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>
---
 remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/remote.c b/remote.c
index d12140e..63f749c 100644
--- a/remote.c
+++ b/remote.c
@@ -1493,7 +1493,7 @@ static int one_local_ref(const char *refname, const unsigned char *sha1, int fla
 
 struct ref *get_local_heads(void)
 {
-	struct ref *local_refs, **local_tail = &local_refs;
+	struct ref *local_refs = NULL, **local_tail = &local_refs;
 	for_each_ref(one_local_ref, &local_tail);
 	return local_refs;
 }
-- 
1.6.2.2.693.g5a1be

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] get_local_heads(): do not return random pointer if there is no head
  2009-04-16 22:16 [PATCH] get_local_heads(): do not return random pointer if there is no head Nguyễn Thái Ngọc Duy
@ 2009-04-18  5:02 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2009-04-18  5:02 UTC (permalink / raw
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> 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.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-18  5:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 22:16 [PATCH] get_local_heads(): do not return random pointer if there is no head Nguyễn Thái Ngọc Duy
2009-04-18  5:02 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.