summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2020-06-11 12:05:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-11 20:35:35 (GMT)
commit460ed0d4b4b460ee721304a90a65f7bf2981dbe1 (patch)
treee6ef650aa7c6a24968b1d6dbdf1f4c0dcbd19aad /upload-pack.c
parent086673482068391dab193c8ef9c8fefb8176a218 (diff)
downloadgit-460ed0d4b4b460ee721304a90a65f7bf2981dbe1.zip
git-460ed0d4b4b460ee721304a90a65f7bf2981dbe1.tar.gz
git-460ed0d4b4b460ee721304a90a65f7bf2981dbe1.tar.bz2
upload-pack: pass upload_pack_data to got_oid()
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's pass that struct to got_oid(), 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 245eda8..6729c17 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -393,8 +393,8 @@ static void create_pack_file(struct upload_pack_data *pack_data)
die("git upload-pack: %s", abort_msg);
}
-static int got_oid(const char *hex, struct object_id *oid,
- struct object_array *have_obj)
+static int got_oid(struct upload_pack_data *data,
+ const char *hex, struct object_id *oid)
{
struct object *o;
int we_knew_they_have = 0;
@@ -422,7 +422,7 @@ static int got_oid(const char *hex, struct object_id *oid,
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 1;
}
return 0;
@@ -478,7 +478,7 @@ static int get_common_commits(struct upload_pack_data *data,
continue;
}
if (skip_prefix(reader->line, "have ", &arg)) {
- switch (got_oid(arg, &oid, &data->have_obj)) {
+ switch (got_oid(data, arg, &oid)) {
case -1: /* they have what we do not */
got_other = 1;
if (data->multi_ack