Re: [PATCH 11/16] promisor-remote: refactor should_accept_remote() control flow
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 26, 2026, 12:21 UTC
- Message-ID
- <acUkwrm1rN4l4qgP@pks.im>
- In-Reply-To
- <20260323080520.887550-12-christian.couder@gmail.com>
On Mon, Mar 23, 2026 at 09:05:14AM +0100, Christian Couder wrote:
Show 17 quoted lines
> diff --git a/promisor-remote.c b/promisor-remote.c
> index 8f2c1280c3..c2f0eb7223 100644
> --- a/promisor-remote.c
> +++ b/promisor-remote.c
> @@ -665,6 +665,12 @@ static int should_accept_remote(enum accept_promisor accept,
> const char *remote_name = advertised->name;
> const char *remote_url = advertised->url;
>
> + if (!remote_url || !*remote_url) {
> + warning(_("no or empty URL advertised for remote '%s', "
> + "ignoring this remote"), remote_name);
> + return 0;
> + }
> +
> if (accept == ACCEPT_ALL)
> return all_fields_match(advertised, config_info, NULL);
> You mention that it shouldn't change behaviour in well-defined cases where the remote sends non-empty URLs. But does it change behaviour in ill-defined cases where the remote sends empty ones?
In other words, does this fix a bug that can be hit in the real world?
Patrick