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

Function best_bisection

bisect.c:187–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187static struct commit_list *best_bisection(struct commit_list *list, int nr)
188{
189 struct commit_list *p, *best;
190 int best_distance = -1;
191
192 best = list;
193 for (p = list; p; p = p->next) {
194 int distance;
195 unsigned commit_flags = p->item->object.flags;
196
197 if (commit_flags & TREESAME)
198 continue;
199 distance = weight(p);
200 if (nr - distance < distance)
201 distance = nr - distance;
202 if (distance > best_distance) {
203 best = p;
204 best_distance = distance;
205 }
206 }
207
208 return best;
209}
210
211struct commit_dist {
212 struct commit *commit;

Callers 1

do_find_bisectionFunction · 0.85

Calls 1

weightFunction · 0.85

Tested by

no test coverage detected