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

Function send_shallow_list

upload-pack.c:908–951  ·  view source on GitHub ↗

Returns 1 if a shallow list is sent or 0 otherwise */

Source from the content-addressed store, hash-verified

906
907/* Returns 1 if a shallow list is sent or 0 otherwise */
908static int send_shallow_list(struct upload_pack_data *data)
909{
910 int ret = 0;
911
912 if (data->depth > 0 && data->deepen_rev_list)
913 die("git upload-pack: deepen and deepen-since (or deepen-not) cannot be used together");
914 if (data->depth > 0) {
915 deepen(data, data->depth);
916 ret = 1;
917 } else if (data->deepen_rev_list) {
918 struct strvec av = STRVEC_INIT;
919 int i;
920
921 strvec_push(&av, "rev-list");
922 if (data->deepen_since)
923 strvec_pushf(&av, "--max-age=%"PRItime, data->deepen_since);
924 if (oidset_size(&data->deepen_not)) {
925 const struct object_id *oid;
926 struct oidset_iter iter;
927 strvec_push(&av, "--not");
928 oidset_iter_init(&data->deepen_not, &iter);
929 while ((oid = oidset_iter_next(&iter)))
930 strvec_push(&av, oid_to_hex(oid));
931 strvec_push(&av, "--not");
932 }
933 for (i = 0; i < data->want_obj.nr; i++) {
934 struct object *o = data->want_obj.objects[i].item;
935 strvec_push(&av, oid_to_hex(&o->oid));
936 }
937 deepen_by_rev_list(data, &av);
938 strvec_clear(&av);
939 ret = 1;
940 } else {
941 if (data->shallows.nr > 0) {
942 int i;
943 for (i = 0; i < data->shallows.nr; i++)
944 register_shallow(the_repository,
945 &data->shallows.objects[i].item->oid);
946 }
947 }
948
949 data->shallow_nr += data->shallows.nr;
950 return ret;
951}
952
953static int process_shallow(const char *line, struct object_array *shallows)
954{

Callers 2

receive_needsFunction · 0.85
send_shallow_infoFunction · 0.85

Calls 11

deepenFunction · 0.85
strvec_pushFunction · 0.85
strvec_pushfFunction · 0.85
oidset_sizeFunction · 0.85
oidset_iter_initFunction · 0.85
oidset_iter_nextFunction · 0.85
oid_to_hexFunction · 0.85
deepen_by_rev_listFunction · 0.85
strvec_clearFunction · 0.85
register_shallowFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected