]> git.ipfire.org Git - thirdparty/git.git/commit
promisor-remote: refactor how we parse advertised fields
authorChristian Couder <christian.couder@gmail.com>
Mon, 8 Sep 2025 05:30:50 +0000 (07:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Sep 2025 17:30:55 +0000 (10:30 -0700)
commitde1efeaf0cee5ca8947ead8b83235e84652c657f
tree417b42595c464698ea0f27eae993b609e1f50852
parent4e2139c9c52766f2853dd42c7ff76eee5ac86449
promisor-remote: refactor how we parse advertised fields

In a follow up commit we are going to parse more fields, like a filter
and a token, coming from the server when it advertises promisor remotes
using the "promisor-remote" capability.

To prepare for this, let's refactor the code that parses the advertised
fields coming from the server into a new parse_one_advertised_remote()
function that will populate a `struct promisor_info` with the content
of the fields it parsed.

While at it, let's also pass this `struct promisor_info` to the
should_accept_remote() function, instead of passing it the parsed name
and url.

These changes will make it simpler to both parse more fields and access
the content of these parsed fields in follow up commits.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
promisor-remote.c