Re: [PATCH 7/7] bundle-uri: fetch a list of bundles
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Sep 8, 2022, 17:10 UTC
- Message-ID
- <c6e4fd5f-b85e-2108-3212-21604e6db986@github.com>
- In-Reply-To
- <20220905125050.83312-1-tenglong.tl@alibaba-inc.com>
On 9/5/2022 8:50 AM, Teng Long wrote:
Show 16 quoted lines
>
> Derrick Stolee <derrickstolee@github.com> writes:
>
>> int fetch_bundle_uri(struct repository *r, const char *uri)
>> {
>> - return fetch_bundle_uri_internal(r, uri, 0);
>> + int result;
>> + struct bundle_list list;
>> + struct remote_bundle_info bundle = {
>> + .uri = xstrdup(uri),
>> + .id = xstrdup("<root>"),
>
> Very readable code, thank you very much.
>
> I'm a little curious why we use the "<root>" as the init value of
> ".id"?In this case, we need a valid ID to initialize the bundle list (since it will add the remote_bundle_info to the hash set), but it is considered the info "above" all other lists. We could also specify an empty string here, but we just can't use NULL.
Thanks, -Stolee