| 753 | } |
| 754 | |
| 755 | static int has_unreachable(struct object_array *src, enum allow_uor allow_uor) |
| 756 | { |
| 757 | struct child_process cmd = CHILD_PROCESS_INIT; |
| 758 | char buf[1]; |
| 759 | int i; |
| 760 | |
| 761 | if (do_reachable_revlist(&cmd, src, NULL, allow_uor) < 0) |
| 762 | goto error; |
| 763 | |
| 764 | /* |
| 765 | * The commits out of the rev-list are not ancestors of |
| 766 | * our ref. |
| 767 | */ |
| 768 | i = read_in_full(cmd.out, buf, 1); |
| 769 | if (i) |
| 770 | goto error; |
| 771 | close(cmd.out); |
| 772 | cmd.out = -1; |
| 773 | |
| 774 | /* |
| 775 | * rev-list may have died by encountering a bad commit |
| 776 | * in the history, in which case we do want to bail out |
| 777 | * even when it showed no commit. |
| 778 | */ |
| 779 | if (finish_command(&cmd)) |
| 780 | goto error; |
| 781 | |
| 782 | /* All the non-tip ones are ancestors of what we advertised */ |
| 783 | return 0; |
| 784 | |
| 785 | error: |
| 786 | if (cmd.out >= 0) |
| 787 | close(cmd.out); |
| 788 | child_process_clear(&cmd); |
| 789 | return 1; |
| 790 | } |
| 791 | |
| 792 | static void check_non_tip(struct upload_pack_data *data) |
| 793 | { |
no test coverage detected