]> git.ipfire.org Git - thirdparty/git.git/commit - list-objects.c
rev-list: detect broken root trees
authorJeff King <peff@peff.net>
Wed, 10 Apr 2019 02:13:25 +0000 (19:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Apr 2019 03:59:39 +0000 (12:59 +0900)
commit97dd512af7ce4afb4f638ef73b4770921c8ca3aa
treecf6d9bf042b2f6ebac6779c99350e8bbcf6470d1
parentee4dfee2274d2fd743066fa9fa4d37441ee522f8
rev-list: detect broken root trees

When the traversal machinery sees a commit without a root tree, it
assumes that the tree was part of a BOUNDARY commit, and quietly ignores
the tree. But it could also be caused by a commit whose root tree is
broken or missing.

Instead, let's die() when we see a NULL root tree. We can differentiate
it from the BOUNDARY case by seeing if the commit was actually parsed.
This covers that case, plus future-proofs us against any others where we
might try to show an unparsed commit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
list-objects.c
t/t6102-rev-list-unexpected-objects.sh