| 171 | } |
| 172 | |
| 173 | static int loop(struct walker *walker) |
| 174 | { |
| 175 | struct object_list *elem; |
| 176 | struct progress *progress = NULL; |
| 177 | uint64_t nr = 0; |
| 178 | |
| 179 | if (walker->get_progress) |
| 180 | progress = start_delayed_progress(the_repository, |
| 181 | _("Fetching objects"), 0); |
| 182 | |
| 183 | while (process_queue) { |
| 184 | struct object *obj = process_queue->item; |
| 185 | elem = process_queue; |
| 186 | process_queue = elem->next; |
| 187 | free(elem); |
| 188 | if (!process_queue) |
| 189 | process_queue_end = &process_queue; |
| 190 | |
| 191 | /* If we are not scanning this object, we placed it in |
| 192 | * the queue because we needed to fetch it first. |
| 193 | */ |
| 194 | if (! (obj->flags & TO_SCAN)) { |
| 195 | if (walker->fetch(walker, &obj->oid)) { |
| 196 | stop_progress(&progress); |
| 197 | report_missing(obj); |
| 198 | return -1; |
| 199 | } |
| 200 | } |
| 201 | if (!obj->type) |
| 202 | parse_object(the_repository, &obj->oid); |
| 203 | if (process_object(walker, obj)) { |
| 204 | stop_progress(&progress); |
| 205 | return -1; |
| 206 | } |
| 207 | display_progress(progress, ++nr); |
| 208 | } |
| 209 | stop_progress(&progress); |
| 210 | return 0; |
| 211 | } |
| 212 | |
| 213 | static int interpret_target(struct walker *walker, char *target, struct object_id *oid) |
| 214 | { |
no test coverage detected