MCPcopy Create free account
hub / github.com/git/git / do_got_oid

Function do_got_oid

upload-pack.c:522–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522static 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
551static int got_oid(struct upload_pack_data *data,
552 const char *hex, struct object_id *oid)

Callers 1

got_oidFunction · 0.85

Calls 4

parse_object_with_flagsFunction · 0.85
oid_to_hexFunction · 0.85
add_object_arrayFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected