@@ -374,6 +374,9 @@ static void do_traverse(struct traversal_context *ctx)
struct tree *tree = get_commit_tree(commit);
tree->object.flags |= NOT_USER_GIVEN;
add_pending_tree(ctx->revs, tree);
+ } else if (commit->object.parsed) {
+ die(_("unable to load root tree for commit %s"),
+ oid_to_hex(&commit->object.oid));
}
ctx->show_commit(commit, ctx->show_data);
@@ -68,8 +68,10 @@ test_expect_success 'traverse unexpected non-tree root (lone)' '
test_must_fail git rev-list --objects $broken_commit
'
-test_expect_failure 'traverse unexpected non-tree root (seen)' '
- test_must_fail git rev-list --objects $blob $broken_commit
+test_expect_success 'traverse unexpected non-tree root (seen)' '
+ test_must_fail git rev-list --objects $blob $broken_commit \
+ >output 2>&1 &&
+ test_i18ngrep "not a tree" output
'
test_expect_success 'setup unexpected non-commit tag' '