Re: [PATCH 5/6] fsck: provide a function to fsck buffer without object struct
- From
Jeff King <peff@peff.net>
- Date
- Jan 19, 2023, 02:07 UTC
- Message-ID
- <Y8il34JHhEqLkdnC@coredump.intra.peff.net>
- In-Reply-To
- <Y8hjiWUAIuiWfJoD@nand.local>
On Wed, Jan 18, 2023 at 04:24:25PM -0500, Taylor Blau wrote:
Show 12 quoted lines
> On Wed, Jan 18, 2023 at 03:43:53PM -0500, Jeff King wrote: > > However, the only external interface that fsck.c provides is > > fsck_object(), which requires an object struct, then promptly discards > > everything except its oid and type. Let's factor out the post-discard > > part of that function as fsck_buffer(), leaving fsck_object() as a thin > > wrapper around it. That will provide more flexibility for callers which > > may not have a struct. > > It's really nice that the only thing we care about having an object > struct around for is basically just knowing its type. IOW it seems to > have made the refactoring here pretty straightforward, which is nice > ;-).
Yeah, it was always in the back of my mind while doing other fsck refactors. But I have to admit that I was surprised that we were so close to the finish line. :)
-Peff