| 790 | } |
| 791 | |
| 792 | static void check_non_tip(struct upload_pack_data *data) |
| 793 | { |
| 794 | int i; |
| 795 | |
| 796 | /* |
| 797 | * In the normal in-process case without |
| 798 | * uploadpack.allowReachableSHA1InWant, |
| 799 | * non-tip requests can never happen. |
| 800 | */ |
| 801 | if (!data->stateless_rpc && !(data->allow_uor & ALLOW_REACHABLE_SHA1)) |
| 802 | goto error; |
| 803 | if (!has_unreachable(&data->want_obj, data->allow_uor)) |
| 804 | /* All the non-tip ones are ancestors of what we advertised */ |
| 805 | return; |
| 806 | |
| 807 | error: |
| 808 | /* Pick one of them (we know there at least is one) */ |
| 809 | for (i = 0; i < data->want_obj.nr; i++) { |
| 810 | struct object *o = data->want_obj.objects[i].item; |
| 811 | if (!is_our_ref(o, data->allow_uor)) { |
| 812 | error("git upload-pack: not our ref %s", |
| 813 | oid_to_hex(&o->oid)); |
| 814 | packet_writer_error(&data->writer, |
| 815 | "upload-pack: not our ref %s", |
| 816 | oid_to_hex(&o->oid)); |
| 817 | exit(128); |
| 818 | } |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | static void send_shallow(struct upload_pack_data *data, |
| 823 | struct commit_list *result) |
no test coverage detected