Message ID | 20211210103435.83656-6-chiyutianyi@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | unpack large objects in stream | expand |
diff --git a/object-file.c b/object-file.c index 455ab3c06e..906590dae5 100644 --- a/object-file.c +++ b/object-file.c @@ -2002,6 +2002,11 @@ int write_object_file_flags(const void *buf, unsigned long len, { char hdr[MAX_HEADER_LEN]; int hdrlen = sizeof(hdr); + if (flags & HASH_STREAM) { + /* Generate the header */ + hdrlen = xsnprintf(hdr, hdrlen, "%s %"PRIuMAX , type, (uintmax_t)len)+1; + return write_loose_object(oid, hdr, hdrlen, buf, len, 0, flags); + } /* Normally if we have it in the pack then we do not bother writing * it out into .git/objects/??/?{38} file.