]> Kevux Git Server - rit/commit
object-file: drop support for writing objects with unknown types
authorJeff King <peff@peff.net>
Fri, 16 May 2025 04:50:13 +0000 (00:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 May 2025 16:43:12 +0000 (09:43 -0700)
commit141f8c8c0535004fa5432d9a6d57bf08129a7dd8
tree59a0e0c7ae4b4b3abbbc5f4498011b110d1344ab
parentf710fd7b49218ce3407a88b2c548704299c7c664
object-file: drop support for writing objects with unknown types

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.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c
object-file.h