Re: [PATCH] bundle-uri: validate that bundle entries have a uri
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 19, 2025, 08:54 UTC
- Message-ID
- <xmqqcy4ax363.fsf@gitster.g>
- In-Reply-To
- <pull.2134.git.git.1766097223647.gitgitgadget@gmail.com>
"Sam Bostock via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 15 quoted lines
> 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 = ..."?