Re: [PATCH 4/6] builtin/receive-pack: report unpack errors via strbuf
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 10, 2026, 05:15 UTC
- Message-ID
- <anlefHYq57Rz5oW9@pks.im>
- In-Reply-To
- <ani4GoefzYFWjTMl@denethor>
On Sun, Aug 09, 2026 at 02:00:52PM -0500, Justin Tobler wrote:
Show 16 quoted lines
> 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