Re: [PATCH] fsck: avoid looking at NULL blob->object
- Date: Sat, 9 Jun 2018 05:20:56 -0400
- From: Jeff King <peff@xxxxxxxx>
- Subject: Re: [PATCH] fsck: avoid looking at NULL blob->object
On Sat, Jun 09, 2018 at 10:45:15AM +0200, Duy Nguyen wrote:
> > It seems like we could refactor report() to just take the
> > object_id itself. But we pass the object pointer along to
> > a callback function, and indeed this ends up in
> > builtin/fsck.c's objreport() which does want to look at
> > other parts of the object (like the type).
> And objreport() can handle OBJ_NONE well, which is the type given by
> lookup_unknown_object(). So yeah this looks good.
Actually, we know that we have some "real" type, because otherwise
lookup_blob() would not have returned NULL. In fact, we could actually
use lookup_object() here to find that object, knowing that it exists in
the hash. But IMHO that would be depending too much on how lookup_blob()