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

Function send_unshallow

upload-pack.c:837–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

835}
836
837static void send_unshallow(struct upload_pack_data *data)
838{
839 int i;
840
841 for (i = 0; i < data->shallows.nr; i++) {
842 struct object *object = data->shallows.objects[i].item;
843 if (object->flags & NOT_SHALLOW) {
844 struct commit_list *parents;
845 packet_writer_write(&data->writer, "unshallow %s",
846 oid_to_hex(&object->oid));
847 object->flags &= ~CLIENT_SHALLOW;
848 /*
849 * We want to _register_ "object" as shallow, but we
850 * also need to traverse object's parents to deepen a
851 * shallow clone. Unregister it for now so we can
852 * parse and add the parents to the want list, then
853 * re-register it.
854 */
855 unregister_shallow(&object->oid);
856 object->parsed = 0;
857 parse_commit_or_die((struct commit *)object);
858 parents = ((struct commit *)object)->parents;
859 while (parents) {
860 add_object_array(&parents->item->object,
861 NULL, &data->want_obj);
862 parents = parents->next;
863 }
864 add_object_array(object, NULL, &data->extra_edge_obj);
865 }
866 /* make sure commit traversal conforms to client */
867 register_shallow(the_repository, &object->oid);
868 }
869}
870
871static int check_ref(const struct reference *ref, void *cb_data);
872

Callers 2

deepenFunction · 0.85
deepen_by_rev_listFunction · 0.85

Calls 6

packet_writer_writeFunction · 0.85
oid_to_hexFunction · 0.85
unregister_shallowFunction · 0.85
parse_commit_or_dieFunction · 0.85
add_object_arrayFunction · 0.85
register_shallowFunction · 0.85

Tested by

no test coverage detected