diff options
| author | Jeff King <peff@peff.net> | 2025-05-16 00:50:13 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-05-16 09:43:12 -0700 |
| commit | 141f8c8c0535004fa5432d9a6d57bf08129a7dd8 (patch) | |
| tree | 59a0e0c7ae4b4b3abbbc5f4498011b110d1344ab /object-file.h | |
| parent | hash-object: handle --literally with OPT_NEGBIT (diff) | |
| download | git-141f8c8c0535004fa5432d9a6d57bf08129a7dd8.tar.gz git-141f8c8c0535004fa5432d9a6d57bf08129a7dd8.zip | |
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>
Diffstat (limited to 'object-file.h')
| -rw-r--r-- | object-file.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/object-file.h b/object-file.h index a979fd5e4d..6f41142452 100644 --- a/object-file.h +++ b/object-file.h @@ -159,7 +159,7 @@ int parse_loose_header(const char *hdr, struct object_info *oi); enum { /* - * By default, `write_object_file_literally()` does not actually write + * By default, `write_object_file()` does not actually write * anything into the object store, but only computes the object ID. * This flag changes that so that the object will be written as a loose * object and persisted. @@ -187,9 +187,6 @@ struct input_stream { int is_finished; }; -int write_object_file_literally(const void *buf, unsigned long len, - const char *type, struct object_id *oid, - unsigned flags); int stream_loose_object(struct input_stream *in_stream, size_t len, struct object_id *oid); |
