path: root/transport-internal.h
diff options
authorBrandon Williams <>2018-03-15 17:31:22 (GMT)
committerJunio C Hamano <>2018-03-15 19:01:08 (GMT)
commit834cf34b26035abc58f7c2b0f2afd5527e93c30d (patch)
tree3138adb283ecc11f6b8e104a53e564866b652a54 /transport-internal.h
parente52449b672210f4b49e116ca34dcd46657287f61 (diff)
transport: convert get_refs_list to take a list of ref prefixes
Convert the 'struct transport' virtual function 'get_refs_list()' to optionally take an argv_array of ref prefixes. When communicating with a server using protocol v2 these ref prefixes can be sent when requesting a listing of their refs allowing the server to filter the refs it sends based on the sent prefixes. This list will be ignored when not using protocol v2. Signed-off-by: Brandon Williams <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'transport-internal.h')
1 files changed, 10 insertions, 1 deletions
diff --git a/transport-internal.h b/transport-internal.h
index 3c1a29d..1cde625 100644
--- a/transport-internal.h
+++ b/transport-internal.h
@@ -3,6 +3,7 @@
struct ref;
struct transport;
+struct argv_array;
struct transport_vtable {
@@ -17,11 +18,19 @@ struct transport_vtable {
* the transport to try to share connections, for_push is a
* hint as to whether the ultimate operation is a push or a fetch.
+ * If communicating using protocol v2 a list of prefixes can be
+ * provided to be sent to the server 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 list will be ignored when not
+ * using protocol v2 meaning this function can return refs which don't
+ * match the provided ref_prefixes.
+ *
* If the transport is able to determine the remote hash for
* the ref without a huge amount of effort, it should store it
* in the ref's old_sha1 field; otherwise it should be all 0.
- struct ref *(*get_refs_list)(struct transport *transport, int for_push);
+ struct ref *(*get_refs_list)(struct transport *transport, int for_push,
+ const struct argv_array *ref_prefixes);
* Fetch the objects for the given refs. Note that this gets