Re: [PATCH 4/6] builtin/receive-pack: report unpack errors via strbuf
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Aug 9, 2026, 19:00 UTC
- Message-ID
- <ani4GoefzYFWjTMl@denethor>
- In-Reply-To
- <anX6w0tFV6pCu1ux@denethor>
On 26/08/07 10:36AM, Justin Tobler wrote:
Show 11 quoted lines
> 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.
-Justin