Implement and bind local_send_wants Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/src/transport_local.c b/src/transport_local.c
index b38679a..6cb261b 100644
--- a/src/transport_local.c
+++ b/src/transport_local.c
@@ -12,6 +12,7 @@ typedef struct {
git_transport parent;
git_repository *repo;
git_vector *refs;
+ git_headarray wants_list;
} transport_local;
/*
@@ -165,10 +166,17 @@ static int local_ls(git_transport *transport, git_headarray *array)
return error;
}
-static int local_send_wants(git_transport *GIT_UNUSED(transport), git_headarray *GIT_UNUSED(array))
+static int local_send_wants(git_transport *transport, git_headarray *array)
{
- GIT_UNUSED_ARG(tranport);
- GIT_UNUSED_ARG(array);
+ transport_local *t = (transport_local *) transport;
+ git_headarray *wants = &t->wants_list;
+
+ /*
+ * We need to store the list of wanted references so we can figure
+ * out what to transmit later.
+ */
+ wants->len = array->len;
+ wants->heads = array->heads;
/* We're local anyway, so we don't need this */
return GIT_SUCCESS;
@@ -215,6 +223,7 @@ int git_transport_local(git_transport **out)
t->parent.connect = local_connect;
t->parent.ls = local_ls;
+ t->parent.send_wants = local_send_wants;
t->parent.close = local_close;
t->parent.free = local_free;