From: Patrick Steinhardt Date: Mon, 10 Aug 2026 05:15:40 GMT Subject: Re: [PATCH 4/6] builtin/receive-pack: report unpack errors via strbuf Message-ID: In-Reply-To: On Sun, Aug 09, 2026 at 02:00:52PM -0500, Justin Tobler wrote: > On 26/08/07 10:36AM, Justin Tobler wrote: > > On 26/08/07 09:03AM, Patrick Steinhardt wrote: > > > > @@ -2711,8 +2719,8 @@ int cmd_receive_pack(int argc, > > > > PACKET_READ_DIE_ON_ERR_PACKET); > > > > > > > > if ((commands = read_head_info(&reader, &shallow))) { > > > > - const char *unpack_status = NULL; > > > > struct string_list push_options = STRING_LIST_INIT_DUP; > > > > + struct strbuf unpack_status = STRBUF_INIT; > > > > > > Can't we reuse this buffer and reset it on every run to save some memory > > > allocations? > > Looking at this more closely, there isn't actually any loop we are > running this in so I don't think there is any need to change how > `unpack_status` is set up here. Oh, right. I think I saw the loop in `read_head_info()` itself. My mistake. Patrick