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

Function handle_duplicate

remote.c:880–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878}
879
880static void handle_duplicate(struct ref *ref1, struct ref *ref2)
881{
882 if (strcmp(ref1->name, ref2->name)) {
883 if (ref1->fetch_head_status != FETCH_HEAD_IGNORE &&
884 ref2->fetch_head_status != FETCH_HEAD_IGNORE) {
885 die(_("Cannot fetch both %s and %s to %s"),
886 ref1->name, ref2->name, ref2->peer_ref->name);
887 } else if (ref1->fetch_head_status != FETCH_HEAD_IGNORE &&
888 ref2->fetch_head_status == FETCH_HEAD_IGNORE) {
889 warning(_("%s usually tracks %s, not %s"),
890 ref2->peer_ref->name, ref2->name, ref1->name);
891 } else if (ref1->fetch_head_status == FETCH_HEAD_IGNORE &&
892 ref2->fetch_head_status == FETCH_HEAD_IGNORE) {
893 die(_("%s tracks both %s and %s"),
894 ref2->peer_ref->name, ref1->name, ref2->name);
895 } else {
896 /*
897 * This last possibility doesn't occur because
898 * FETCH_HEAD_IGNORE entries always appear at
899 * the end of the list.
900 */
901 BUG("Internal error");
902 }
903 }
904 free(ref2->peer_ref);
905 free(ref2);
906}
907
908struct ref *ref_remove_duplicates(struct ref *ref_map)
909{

Callers 1

ref_remove_duplicatesFunction · 0.85

Calls 2

warningFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected