Re: [PATCH 13/13] object-file: drop support for writing objects with unknown types
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 16, 2025, 09:52 UTC
- Message-ID
- <aCcK6quAx_q28ltu@pks.im>
- In-Reply-To
- <20250516045013.GM22242@coredump.intra.peff.net>
On Fri, May 16, 2025 at 12:50:13AM -0400, Jeff King wrote:
Show 13 quoted lines
> Since "hash-object --literally" no longer supports objects with unknown > types, there are now no callers of write_object_file_literally() and its > helpers. Let's drop them to simplify the code. > > In particular, this gets rid of some ugly copy-and-paste code from > write_object_file_literally(), which is a parallel implementation of > write_object_file(). When the split was originally made, the two weren't > that long, but commits like 63a6745a07 (object-file: update the loose > object map when writing loose objects, 2023-10-01) ended up having to > duplicate some tricky code. > > This patch drops all of that duplication and should make things less > error-prone going forward.
Just today I was looking at this code and pondered what to do about it with pluggable object databases. I started unifying those code paths, but all the results looked quite ugly. I am thus very happy to see that it just goes away completely. Thank you for making my life easier!
Patrick