From d2956385a9319155928e2d7bc5f9d90eeac5d0a5 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 16 May 2025 00:49:56 -0400 Subject: oid_object_info(): drop type_name strbuf We provide a mechanism for callers to get the object type as a raw string, rather than an object_type enum. This was in theory useful for returning types that are not representable in the enum, but we consider any such type to be an error, and there are no callers that use the strbuf anymore. Let's drop support to simplify the code a bit. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- object-file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'object-file.c') diff --git a/object-file.c b/object-file.c index 7a35bde96e..b10e283529 100644 --- a/object-file.c +++ b/object-file.c @@ -403,8 +403,6 @@ int parse_loose_header(const char *hdr, struct object_info *oi) } type = type_from_string_gently(type_buf, type_len, 1); - if (oi->type_name) - strbuf_add(oi->type_name, type_buf, type_len); if (oi->typep) *oi->typep = type; @@ -466,7 +464,7 @@ int loose_object_info(struct repository *r, * return value implicitly indicates whether the * object even exists. */ - if (!oi->typep && !oi->type_name && !oi->sizep && !oi->contentp) { + if (!oi->typep && !oi->sizep && !oi->contentp) { struct stat st; if (!oi->disk_sizep && (flags & OBJECT_INFO_QUICK)) return quick_has_loose(r, oid) ? 0 : -1; -- cgit v1.2.3