Re: [PATCH GSoC RFC v13 10/12] cat-file: add remote-object-info to batch-command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 21, 2026, 20:02 UTC
- Message-ID
- <xmqqo6h37jbk.fsf@gitster.g>
- In-Reply-To
- <CA+J6zkTjgHAWtJwxY8jo0i9zDtxwj9uUsKAtLS3z1=WxZfr8Zw@mail.gmail.com>
Chandra Pratap <chandrapratap3519@gmail.com> writes:
Show 14 quoted lines
> [snip]
>> +static void parse_cmd_remote_object_info(struct batch_options *opt,
>> + const char *line, struct strbuf *output,
>> + struct expand_data *data)
>> +{
>> + int count;
>> + const char **argv;
>> + char *line_to_split;
>> + static struct object_info *remote_object_info;
>> + static struct oid_array object_info_oids = OID_ARRAY_INIT;
>
> I don't get the point of remote_object_info and object_info_oids
> being static here? These variables are allocated, utilized, and
> completely freed/disconnected within a single command cycle.Great observation.
> Making them static gives me the false impression that state > needs to persist between calls.
Yes, and makes it thread-unsafe, even though if is questionable if this particular function has to be thread safe ;-)