get_tree_entry(): do not call find_tree_entry() on an empty tree
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Oct 2011 18:18:40 +0000 (11:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Oct 2011 18:24:01 +0000 (11:24 -0700)
We know we will find nothing.

This incidentally squelches false warning from gcc about potentially
uninitialized usage of t.entry fields. For an empty tree, it is true that
init_tree_desc() does not call decode_tree_entry() and the tree_desc is
left uninitialized, but find_tree_entry() only calls tree_entry_extract()
that uses the tree_desc while it has more things to read from the tree, so
the uninitialized t.entry fields are never used in such a case anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

No differences found