summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2020-06-11 12:05:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-11 20:35:35 (GMT)
commit8dcf22785f33ad65f6ceefa33480dfa09749590a (patch)
tree3f76d2bcd3620a7fc11c028323c00fb4ebc7adcd /upload-pack.c
parent629060d9bb5a1ab63d51b1a8fbe19384c1559140 (diff)
downloadgit-8dcf22785f33ad65f6ceefa33480dfa09749590a.zip
git-8dcf22785f33ad65f6ceefa33480dfa09749590a.tar.gz
git-8dcf22785f33ad65f6ceefa33480dfa09749590a.tar.bz2
upload-pack: pass upload_pack_data to process_haves()
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's pass that struct to process_haves(), so that this function can use all the fields of the struct. This will be used in followup commits to move a static variable 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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 0b30794..b20600f 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1348,14 +1348,13 @@ static void process_args(struct packet_reader *request,
die(_("expected flush after fetch arguments"));
}
-static int process_haves(struct oid_array *haves, struct oid_array *common,
- struct object_array *have_obj)
+static int process_haves(struct upload_pack_data *data, struct oid_array *common)
{
int i;
/* Process haves */
- for (i = 0; i < haves->nr; i++) {
- const struct object_id *oid = &haves->oid[i];
+ for (i = 0; i < data->haves.nr; i++) {
+ const struct object_id *oid = &data->haves.oid[i];
struct object *o;
int we_knew_they_have = 0;
@@ -1382,7 +1381,7 @@ static int process_haves(struct oid_array *haves, struct oid_array *common,
parents->item->object.flags |= THEY_HAVE;
}
if (!we_knew_they_have)
- add_object_array(o, NULL, have_obj);
+ add_object_array(o, NULL, &data->have_obj);
}
return 0;
@@ -1419,7 +1418,7 @@ static int process_haves_and_send_acks(struct upload_pack_data *data)
struct oid_array common = OID_ARRAY_INIT;
int ret = 0;
- process_haves(&data->haves, &common, &data->have_obj);
+ process_haves(data, &common);
if (data->done) {
ret = 1;
} else if (send_acks(&data->writer, &common,