@matheusbsbs / matheus-bagliano / commits / c34066358a
Fork 0

reachable.c::add_one_tree: handle NULL from lookup_tree

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Martin Koegler committed Feb 18, 2008 at 21:47 UTC c34066358a604e3ccb6afcf5679fa8a84be79936
1 file changed +2 -1
reachable.c
+2 -1
@@ -150,7 +150,8 @@ static int add_one_reflog(const char *path, const unsigned char *sha1, int flag,
150 static void add_one_tree(const unsigned char *sha1, struct rev_info *revs)
151 {
152 struct tree *tree = lookup_tree(sha1);
153 - add_pending_object(revs, &tree->object, "");
153 + if (tree)
154 + add_pending_object(revs, &tree->object, "");
155 }
156
157 static void add_cache_tree(struct cache_tree *it, struct rev_info *revs)