summaryrefslogtreecommitdiff
path: root/worktree.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2019-04-09 19:13:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-04-10 12:59:39 +0900
commit834876630b21f832f648bc46a753291e4512ca8f (patch)
tree7e01f8442e179e5b3eb130fa408a2b473422eb65 /worktree.c
parentlist-objects.c: handle unexpected non-tree entries (diff)
downloadtgif-834876630b21f832f648bc46a753291e4512ca8f.tar.xz
get_commit_tree(): return NULL for broken tree
Return NULL from 'get_commit_tree()' when a commit's root tree is corrupt, doesn't exist, or points to an object which is not a tree. In [1], this situation became a BUG(), but it can certainly occur in cases which are not a bug in Git, for e.g., if a caller manually crafts a commit whose tree is corrupt in any of the above ways. Note that the expect_failure test in t6102 triggers this BUG(), but we can't flip it to expect_success yet. Solving this problem actually reveals a second bug. [1]: 7b8a21dba1 (commit-graph: lazy-load trees for commits, 2018-04-06) Co-authored-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'worktree.c')
0 files changed, 0 insertions, 0 deletions