summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2020-06-11 12:05:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-11 20:35:34 (GMT)
commit329f9960505ba4af082614890bac205054701ede (patch)
tree4d5c95de074a2b3c63755d86e887edde8856dc86 /upload-pack.c
parent446e42c559c79e7dae34b584fef4f7c26dee5198 (diff)
downloadgit-329f9960505ba4af082614890bac205054701ede.zip
git-329f9960505ba4af082614890bac205054701ede.tar.gz
git-329f9960505ba4af082614890bac205054701ede.tar.bz2
upload-pack: pass upload_pack_data to send_unshallow()
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>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/upload-pack.c b/upload-pack.c
index aa8cde6..3b4749d 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -715,17 +715,15 @@ static void send_shallow(struct packet_writer *writer,
}
}
-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)
{
int i;
- 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;
- packet_writer_write(writer, "unshallow %s",
+ packet_writer_write(&data->writer, "unshallow %s",
oid_to_hex(&object->oid));
object->flags &= ~CLIENT_SHALLOW;
/*
@@ -741,7 +739,7 @@ static void send_unshallow(struct packet_writer *writer,
parents = ((struct commit *)object)->parents;
while (parents) {
add_object_array(&parents->item->object,
- NULL, want_obj);
+ NULL, &data->want_obj);
parents = parents->next;
}
add_object_array(object, NULL, &extra_edge_obj);
@@ -789,7 +787,7 @@ static void deepen(struct upload_pack_data *data, int depth)
free_commit_list(result);
}
- send_unshallow(&data->writer, &data->shallows, &data->want_obj);
+ send_unshallow(data);
}
static void deepen_by_rev_list(struct upload_pack_data *data,
@@ -802,7 +800,7 @@ 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);
- send_unshallow(&data->writer, &data->shallows, &data->want_obj);
+ send_unshallow(data);
}
/* Returns 1 if a shallow list is sent or 0 otherwise */