aboutsummaryrefslogtreecommitdiffstats
path: root/object-file.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2025-05-16 00:49:45 -0400
committerJunio C Hamano <gitster@pobox.com>2025-05-16 09:43:10 -0700
commitae24b032a04ccd1565cb1ce13317b56daa77ce7f (patch)
treefc7b0a0a277282ee277e95dc2ab5452dc8f92612 /object-file.h
parentf227fc7d43d9607edb286eaab0f7714a2f1e4659 (diff)
downloadgit-ae24b032a04ccd1565cb1ce13317b56daa77ce7f.tar.gz
object-file: drop OBJECT_INFO_ALLOW_UNKNOWN_TYPE flag
Since cat-file dropped its "--allow-unknown-type" option in the previous commit, there are no more uses of the internal flag that implemented it. Let's drop it. That in turn lets us drop the strbuf parameter of unpack_loose_header(), which now is always NULL. And without that, we can drop all of the additional code to inflate larger headers into the strbuf. Arguably we could drop ULHR_TOO_LONG, as no callers really care about the distinction from ULHR_BAD. But it's easy enough to retain, and it does let us produce a slightly more specific message in one instance. 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.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/object-file.h b/object-file.h
index fd715663fb..a979fd5e4d 100644
--- a/object-file.h
+++ b/object-file.h
@@ -133,12 +133,7 @@ int format_object_header(char *str, size_t size, enum object_type type,
* - ULHR_BAD on error
* - ULHR_TOO_LONG if the header was too long
*
- * It will only parse up to MAX_HEADER_LEN bytes unless an optional
- * "hdrbuf" argument is non-NULL. This is intended for use with
- * OBJECT_INFO_ALLOW_UNKNOWN_TYPE to extract the bad type for (error)
- * reporting. The full header will be extracted to "hdrbuf" for use
- * with parse_loose_header(), ULHR_TOO_LONG will still be returned
- * from this function to indicate that the header was too long.
+ * It will only parse up to MAX_HEADER_LEN bytes.
*/
enum unpack_loose_header_result {
ULHR_OK,
@@ -149,8 +144,7 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
unsigned char *map,
unsigned long mapsize,
void *buffer,
- unsigned long bufsiz,
- struct strbuf *hdrbuf);
+ unsigned long bufsiz);
/**
* parse_loose_header() parses the starting "<type> <len>\0" of an