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

Function count_distance

bisect.c:45–70  ·  view source on GitHub ↗

* This is a truly stupid algorithm, but it's only * used for bisection, and we just don't care enough. * * We care just barely enough to avoid recursing for * non-merge entries. */

Source from the content-addressed store, hash-verified

43 * non-merge entries.
44 */
45static int count_distance(struct commit_list *entry)
46{
47 int nr = 0;
48
49 while (entry) {
50 struct commit *commit = entry->item;
51 struct commit_list *p;
52
53 if (commit->object.flags & (UNINTERESTING | COUNTED))
54 break;
55 if (!(commit->object.flags & TREESAME))
56 nr++;
57 commit->object.flags |= COUNTED;
58 p = commit->parents;
59 entry = p;
60 if (p) {
61 p = p->next;
62 while (p) {
63 nr += count_distance(p);
64 p = p->next;
65 }
66 }
67 }
68
69 return nr;
70}
71
72static void clear_distance(struct commit_list *list)
73{

Callers 1

do_find_bisectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected