}
}
-static int count_parents(struct commit *commit)
-{
- struct commit_list *parents = commit->parents;
- int count = 0;
- while (parents) {
- count++;
- parents = parents->next;
- }
- return count;
-}
-
static void move_diff_queue(struct diff_queue_struct *dst,
struct diff_queue_struct *src)
{
struct commit **parents;
struct commit_list *p;
int i;
- int nparents = count_parents(commit);
+ int nparents = commit_list_count(commit->parents);
diffqueues = xmalloc(nparents * sizeof(*diffqueues));
cand = xmalloc(nparents * sizeof(*cand));