From 1af8ae1cfa44a3f3c3f1efb7f9ebe68bc0ce7578 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 15 Mar 2018 10:31:23 -0700 Subject: transport: convert transport_get_remote_refs to take a list of ref prefixes Teach transport_get_remote_refs() to accept a list of ref prefixes, which will be sent to the server for use in filtering when using protocol v2. (This list will be ignored when not using protocol v2.) Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- transport.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'transport.h') diff --git a/transport.h b/transport.h index 731c78b679..83992a4257 100644 --- a/transport.h +++ b/transport.h @@ -178,7 +178,17 @@ int transport_push(struct transport *connection, int refspec_nr, const char **refspec, int flags, unsigned int * reject_reasons); -const struct ref *transport_get_remote_refs(struct transport *transport); +/* + * Retrieve refs from a remote. + * + * Optionally a list of ref prefixes can be provided which can be sent to the + * server (when communicating using protocol v2) to enable it to limit the ref + * advertisement. Since ref filtering is done on the server's end (and only + * when using protocol v2), this can return refs which don't match the provided + * ref_prefixes. + */ +const struct ref *transport_get_remote_refs(struct transport *transport, + const struct argv_array *ref_prefixes); int transport_fetch_refs(struct transport *transport, struct ref *refs); void transport_unlock_pack(struct transport *transport); -- cgit v1.2.3