| 520 | } |
| 521 | |
| 522 | static int do_got_oid(struct upload_pack_data *data, const struct object_id *oid) |
| 523 | { |
| 524 | struct object *o = parse_object_with_flags(the_repository, oid, |
| 525 | PARSE_OBJECT_SKIP_HASH_CHECK | |
| 526 | PARSE_OBJECT_DISCARD_TREE); |
| 527 | |
| 528 | if (!o) |
| 529 | die("oops (%s)", oid_to_hex(oid)); |
| 530 | |
| 531 | if (o->type == OBJ_COMMIT) { |
| 532 | struct commit_list *parents; |
| 533 | struct commit *commit = (struct commit *)o; |
| 534 | |
| 535 | if (!data->oldest_have || (commit->date < data->oldest_have)) |
| 536 | data->oldest_have = commit->date; |
| 537 | for (parents = commit->parents; |
| 538 | parents; |
| 539 | parents = parents->next) |
| 540 | parents->item->object.flags |= THEY_HAVE; |
| 541 | } |
| 542 | |
| 543 | if (o->flags & THEY_HAVE) |
| 544 | return 0; |
| 545 | o->flags |= THEY_HAVE; |
| 546 | |
| 547 | add_object_array(o, NULL, &data->have_obj); |
| 548 | return 1; |
| 549 | } |
| 550 | |
| 551 | static int got_oid(struct upload_pack_data *data, |
| 552 | const char *hex, struct object_id *oid) |
no test coverage detected