checkout, clone: die if tree cannot be parsed
commit8d2eaf649abd28baa083a723d1e041b26d2be83e
authorGlen Choo <chooglen@google.com>
Wed, 2 Mar 2022 00:36:13 +0000 (1 16:36 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Mar 2022 07:27:09 +0000 (1 23:27 -0800)
treeae72cb98b4b15b4b19187a5d96aab76d3bcf9258
parent4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a
checkout, clone: die if tree cannot be parsed

When a tree oid is invalid, parse_tree_indirect() can return NULL. Check
for NULL instead of proceeding as though it were a valid pointer and
segfaulting.

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c
builtin/clone.c