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

Function skip_away

bisect.c:623–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621}
622
623static struct commit_list *skip_away(struct commit_list *list, int count)
624{
625 struct commit_list *cur, *previous, *result = list;
626 int prn, index, i;
627
628 prn = get_prn(count);
629 index = (count * prn / PRN_MODULO) * sqrti(prn) / sqrti(PRN_MODULO);
630
631 cur = list;
632 previous = NULL;
633
634 for (i = 0; cur; cur = cur->next, i++) {
635 if (i == index) {
636 if (!oideq(&cur->item->object.oid, current_bad_oid))
637 result = cur;
638 else if (previous)
639 result = previous;
640 else
641 result = list;
642 break;
643 }
644 previous = cur;
645 }
646
647 for (cur = list; cur != result; ) {
648 struct commit_list *next = cur->next;
649 free(cur);
650 cur = next;
651 }
652
653 return result;
654}
655
656static struct commit_list *managed_skipped(struct commit_list *list,
657 struct commit_list **tried)

Callers 1

managed_skippedFunction · 0.85

Calls 3

get_prnFunction · 0.85
sqrtiFunction · 0.85
oideqFunction · 0.85

Tested by

no test coverage detected