As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
more thoroughly, let's pass that struct to send_unshallow(), so
that this function can use all the fields of the struct.
This will be used in followup commits to move static variables
into 'upload_pack_data'.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-static void send_unshallow(struct packet_writer *writer,
- const struct object_array *shallows,
- struct object_array *want_obj)
+static void send_unshallow(struct upload_pack_data *data)
- for (i = 0; i < shallows->nr; i++) {
- struct object *object = shallows->objects[i].item;
+ for (i = 0; i < data->shallows.nr; i++) {
+ struct object *object = data->shallows.objects[i].item;
if (object->flags & NOT_SHALLOW) {
struct commit_list *parents;
if (object->flags & NOT_SHALLOW) {
struct commit_list *parents;
- packet_writer_write(writer, "unshallow %s",
+ packet_writer_write(&data->writer, "unshallow %s",
oid_to_hex(&object->oid));
object->flags &= ~CLIENT_SHALLOW;
/*
oid_to_hex(&object->oid));
object->flags &= ~CLIENT_SHALLOW;
/*
parents = ((struct commit *)object)->parents;
while (parents) {
add_object_array(&parents->item->object,
parents = ((struct commit *)object)->parents;
while (parents) {
add_object_array(&parents->item->object,
+ NULL, &data->want_obj);
parents = parents->next;
}
add_object_array(object, NULL, &extra_edge_obj);
parents = parents->next;
}
add_object_array(object, NULL, &extra_edge_obj);
free_commit_list(result);
}
free_commit_list(result);
}
- send_unshallow(&data->writer, &data->shallows, &data->want_obj);
}
static void deepen_by_rev_list(struct upload_pack_data *data,
}
static void deepen_by_rev_list(struct upload_pack_data *data,
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
send_shallow(&data->writer, result);
free_commit_list(result);
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
send_shallow(&data->writer, result);
free_commit_list(result);
- send_unshallow(&data->writer, &data->shallows, &data->want_obj);
}
/* Returns 1 if a shallow list is sent or 0 otherwise */
}
/* Returns 1 if a shallow list is sent or 0 otherwise */