Skip to content

Commit 460ed0d

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0866734 commit 460ed0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

upload-pack.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ static void create_pack_file(struct upload_pack_data *pack_data)
393393
die("git upload-pack: %s", abort_msg);
394394
}
395395

396-
static int got_oid(const char *hex, struct object_id *oid,
397-
struct object_array *have_obj)
396+
static int got_oid(struct upload_pack_data *data,
397+
const char *hex, struct object_id *oid)
398398
{
399399
struct object *o;
400400
int we_knew_they_have = 0;
@@ -422,7 +422,7 @@ static int got_oid(const char *hex, struct object_id *oid,
422422
parents->item->object.flags |= THEY_HAVE;
423423
}
424424
if (!we_knew_they_have) {
425-
add_object_array(o, NULL, have_obj);
425+
add_object_array(o, NULL, &data->have_obj);
426426
return 1;
427427
}
428428
return 0;
@@ -478,7 +478,7 @@ static int get_common_commits(struct upload_pack_data *data,
478478
continue;
479479
}
480480
if (skip_prefix(reader->line, "have ", &arg)) {
481-
switch (got_oid(arg, &oid, &data->have_obj)) {
481+
switch (got_oid(data, arg, &oid)) {
482482
case -1: /* they have what we do not */
483483
got_other = 1;
484484
if (data->multi_ack

0 commit comments

Comments
 (0)