Subject: Re: [PATCH v2 02/10] promisor-remote: pass config entry to all_fields_match() directly

From: Junio C Hamano <[email-masked]>
Date: Tue, 07 Apr 2026 09:56:22 -0700

Christian Couder <[email-masked]> writes:

> This removes the hidden dependency on `advertised->name` inside
> all_fields_match(), which would be wrong if in the future
> auto-configured remotes are implemented, as the local config name may
> differ from the server's advertised name.

Interesting.

The caller, should_accept_remote(), still uses remote_name variable
that is an alias to advertised->name to find the config_entry to
pass down the callchain, so this step does not change the fact that
we are still using their name and not overriding it with our local
name, but hopefully we will see such a change on the caller's side
to allow us do so.

> While at it, let's also add a comment before all_fields_match() and
> match_field_against_config() to help understand how things work and
> help avoid similar issues.

Very well done.