MCPcopy Create free account
hub / github.com/git/git / has_unreachable

Function has_unreachable

upload-pack.c:755–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755static 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
785error:
786 if (cmd.out >= 0)
787 close(cmd.out);
788 child_process_clear(&cmd);
789 return 1;
790}
791
792static void check_non_tip(struct upload_pack_data *data)
793{

Callers 1

check_non_tipFunction · 0.85

Calls 4

do_reachable_revlistFunction · 0.85
read_in_fullFunction · 0.85
finish_commandFunction · 0.85
child_process_clearFunction · 0.85

Tested by

no test coverage detected