summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-03-15 17:31:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-15 19:01:08 (GMT)
commit834cf34b26035abc58f7c2b0f2afd5527e93c30d (patch)
tree3138adb283ecc11f6b8e104a53e564866b652a54 /transport-helper.c
parente52449b672210f4b49e116ca34dcd46657287f61 (diff)
downloadgit-834cf34b26035abc58f7c2b0f2afd5527e93c30d.zip
git-834cf34b26035abc58f7c2b0f2afd5527e93c30d.tar.gz
git-834cf34b26035abc58f7c2b0f2afd5527e93c30d.tar.bz2
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 <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 5080150..8774ab3 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -1026,7 +1026,8 @@ static int has_attribute(const char *attrs, const char *attr) {
}
}
-static struct ref *get_refs_list(struct transport *transport, int for_push)
+static struct ref *get_refs_list(struct transport *transport, int for_push,
+ const struct argv_array *ref_prefixes)
{
struct helper_data *data = transport->data;
struct child_process *helper;
@@ -1039,7 +1040,7 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)
if (process_connect(transport, for_push)) {
do_take_over(transport);
- return transport->vtable->get_refs_list(transport, for_push);
+ return transport->vtable->get_refs_list(transport, for_push, ref_prefixes);
}
if (data->push && for_push)