| 1128 | } |
| 1129 | |
| 1130 | static struct ref *do_fetch_pack(struct fetch_pack_args *args, |
| 1131 | int fd[2], |
| 1132 | const struct ref *orig_ref, |
| 1133 | struct ref **sought, int nr_sought, |
| 1134 | struct shallow_info *si, |
| 1135 | struct string_list *pack_lockfiles) |
| 1136 | { |
| 1137 | struct fsck_options fsck_options = { 0 }; |
| 1138 | struct repository *r = the_repository; |
| 1139 | struct ref *ref = copy_ref_list(orig_ref); |
| 1140 | struct object_id oid; |
| 1141 | const char *agent_feature; |
| 1142 | size_t agent_len; |
| 1143 | struct fetch_negotiator negotiator_alloc; |
| 1144 | struct fetch_negotiator *negotiator; |
| 1145 | |
| 1146 | negotiator = &negotiator_alloc; |
| 1147 | if (args->refetch) { |
| 1148 | fetch_negotiator_init_noop(negotiator); |
| 1149 | } else { |
| 1150 | fetch_negotiator_init(r, negotiator); |
| 1151 | } |
| 1152 | |
| 1153 | sort_ref_list(&ref, ref_compare_name); |
| 1154 | QSORT(sought, nr_sought, cmp_ref_by_name); |
| 1155 | |
| 1156 | if ((agent_feature = server_feature_value("agent", &agent_len))) { |
| 1157 | agent_supported = 1; |
| 1158 | if (agent_len) |
| 1159 | print_verbose(args, _("Server version is %.*s"), |
| 1160 | (int)agent_len, agent_feature); |
| 1161 | } |
| 1162 | |
| 1163 | if (!server_supports("session-id")) |
| 1164 | advertise_sid = 0; |
| 1165 | |
| 1166 | if (server_supports("shallow")) |
| 1167 | print_verbose(args, _("Server supports %s"), "shallow"); |
| 1168 | else if (args->depth > 0 || is_repository_shallow(r)) |
| 1169 | die(_("Server does not support shallow clients")); |
| 1170 | if (args->depth > 0 || args->deepen_since || args->deepen_not) |
| 1171 | args->deepen = 1; |
| 1172 | if (server_supports("multi_ack_detailed")) { |
| 1173 | print_verbose(args, _("Server supports %s"), "multi_ack_detailed"); |
| 1174 | multi_ack = 2; |
| 1175 | if (server_supports("no-done")) { |
| 1176 | print_verbose(args, _("Server supports %s"), "no-done"); |
| 1177 | if (args->stateless_rpc) |
| 1178 | no_done = 1; |
| 1179 | } |
| 1180 | } |
| 1181 | else if (server_supports("multi_ack")) { |
| 1182 | print_verbose(args, _("Server supports %s"), "multi_ack"); |
| 1183 | multi_ack = 1; |
| 1184 | } |
| 1185 | if (server_supports("side-band-64k")) { |
| 1186 | print_verbose(args, _("Server supports %s"), "side-band-64k"); |
| 1187 | use_sideband = 2; |
no test coverage detected