wt-status.h: drop stdio.h include
[gitweb.git] / list-objects.c
index ea04bbdee6a938d02d46fc400471a62a553da1a1..b5651ddd5bfdd6cda4047f71cc3cb66fc31a793d 100644 (file)
@@ -125,6 +125,11 @@ static void process_tree_contents(struct traversal_context *ctx,
 
                if (S_ISDIR(entry.mode)) {
                        struct tree *t = lookup_tree(ctx->revs->repo, &entry.oid);
+                       if (!t) {
+                               die(_("entry '%s' in tree %s has tree mode, "
+                                     "but is not a tree"),
+                                   entry.path, oid_to_hex(&tree->object.oid));
+                       }
                        t->object.flags |= NOT_USER_GIVEN;
                        process_tree(ctx, t, base, entry.path);
                }
@@ -369,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);