MCPcopy Index your code
hub / github.com/git/git / receive_needs

Function receive_needs

upload-pack.c:1083–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081}
1082
1083static void receive_needs(struct upload_pack_data *data,
1084 struct packet_reader *reader)
1085{
1086 int has_non_tip = 0;
1087
1088 data->shallow_nr = 0;
1089 for (;;) {
1090 struct object *o;
1091 const char *features;
1092 struct object_id oid_buf;
1093 const char *arg;
1094 size_t feature_len;
1095
1096 reset_timeout(data->timeout);
1097 if (packet_reader_read(reader) != PACKET_READ_NORMAL)
1098 break;
1099
1100 if (process_shallow(reader->line, &data->shallows))
1101 continue;
1102 if (process_deepen(reader->line, &data->depth))
1103 continue;
1104 if (process_deepen_since(reader->line, &data->deepen_since, &data->deepen_rev_list))
1105 continue;
1106 if (process_deepen_not(reader->line, &data->deepen_not, &data->deepen_rev_list))
1107 continue;
1108
1109 if (skip_prefix(reader->line, "filter ", &arg)) {
1110 if (!data->filter_capability_requested)
1111 die("git upload-pack: filtering capability not negotiated");
1112 list_objects_filter_die_if_populated(&data->filter_options);
1113 parse_list_objects_filter(&data->filter_options, arg);
1114 die_if_using_banned_filter(data);
1115 continue;
1116 }
1117
1118 if (!skip_prefix(reader->line, "want ", &arg) ||
1119 parse_oid_hex(arg, &oid_buf, &features))
1120 die("git upload-pack: protocol error, "
1121 "expected to get object ID, not '%s'", reader->line);
1122
1123 if (parse_feature_request(features, "deepen-relative"))
1124 data->deepen_relative = 1;
1125 if (parse_feature_request(features, "multi_ack_detailed"))
1126 data->multi_ack = MULTI_ACK_DETAILED;
1127 else if (parse_feature_request(features, "multi_ack"))
1128 data->multi_ack = MULTI_ACK;
1129 if (parse_feature_request(features, "no-done"))
1130 data->no_done = 1;
1131 if (parse_feature_request(features, "thin-pack"))
1132 data->use_thin_pack = 1;
1133 if (parse_feature_request(features, "ofs-delta"))
1134 data->use_ofs_delta = 1;
1135 if (parse_feature_request(features, "side-band-64k"))
1136 data->use_sideband = LARGE_PACKET_MAX;
1137 else if (parse_feature_request(features, "side-band"))
1138 data->use_sideband = DEFAULT_PACKET_MAX;
1139 if (parse_feature_request(features, "no-progress"))
1140 data->no_progress = 1;

Callers 1

upload_packFunction · 0.85

Calls 15

reset_timeoutFunction · 0.85
packet_reader_readFunction · 0.85
process_deepenFunction · 0.85
process_deepen_sinceFunction · 0.85
process_deepen_notFunction · 0.85
parse_oid_hexFunction · 0.85
parse_feature_requestFunction · 0.85
parse_feature_valueFunction · 0.85
xstrndupFunction · 0.85

Tested by

no test coverage detected