Subject: Re: [PATCH] bundle-uri: validate that bundle entries have a uri

From: Junio C Hamano <[email-masked]>
Date: Fri, 19 Dec 2025 17:54:12 +0900

"Sam Bostock via GitGitGadget" <[email-masked]> writes:

>  bundle-uri.c                | 22 +++++++++++++++++++++-
>  t/t5750-bundle-uri-parse.sh | 26 ++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+), 1 deletion(-)
>
> diff --git a/bundle-uri.c b/bundle-uri.c
> index 57cccfc6b8..022e2109a6 100644
> --- a/bundle-uri.c
> +++ b/bundle-uri.c
> @@ -89,7 +89,8 @@ static int summarize_bundle(struct remote_bundle_info *info, void *data)
>  {
>  	FILE *fp = data;
>  	fprintf(fp, "[bundle \"%s\"]\n", info->id);
> -	fprintf(fp, "\turi = %s\n", info->uri);
> +	if (info->uri)
> +		fprintf(fp, "\turi = %s\n", info->uri);

All the other code paths error out when info->uri is missing; I can
understand that print_bundle_list() want to keep going as it is
primarily for debugging, but then don't we want to more loudly
report that a mandatory thing info->uri is missing, rather than a
subtle hint that is lack of expected line that shows "uri = ..."?