| 669 | } |
| 670 | |
| 671 | static int add_send_request(struct object *obj, struct remote_lock *lock) |
| 672 | { |
| 673 | struct transfer_request *request; |
| 674 | struct packed_git *target; |
| 675 | |
| 676 | /* Keep locks active */ |
| 677 | check_locks(); |
| 678 | |
| 679 | /* |
| 680 | * Don't push the object if it's known to exist on the remote |
| 681 | * or is already in the request queue |
| 682 | */ |
| 683 | if (remote_dir_exists[obj->oid.hash[0]] == -1) |
| 684 | get_remote_object_list(obj->oid.hash[0]); |
| 685 | if (obj->flags & (REMOTE | PUSHING)) |
| 686 | return 0; |
| 687 | target = packfile_list_find_oid(repo->packs.head, &obj->oid); |
| 688 | if (target) { |
| 689 | obj->flags |= REMOTE; |
| 690 | return 0; |
| 691 | } |
| 692 | |
| 693 | obj->flags |= PUSHING; |
| 694 | CALLOC_ARRAY(request, 1); |
| 695 | request->obj = obj; |
| 696 | request->lock = lock; |
| 697 | request->state = NEED_PUSH; |
| 698 | strbuf_init(&request->buffer.buf, 0); |
| 699 | request->next = request_queue_head; |
| 700 | request_queue_head = request; |
| 701 | |
| 702 | fill_active_slots(); |
| 703 | step_active_slots(); |
| 704 | |
| 705 | return 1; |
| 706 | } |
| 707 | |
| 708 | static int fetch_indices(void) |
| 709 | { |
no test coverage detected