@ -283,18 +283,6 @@ static void grab_tag_values(struct atom_value *val, int deref, struct object *ob
}
}
}
}
static int num_parents(struct commit *commit)
{
struct commit_list *parents;
int i;
for (i = 0, parents = commit->parents;
parents;
parents = parents->next)
i++;
return i;
}
/* See grab_values */
/* See grab_values */
static void grab_commit_values(struct atom_value *val, int deref, struct object *obj, void *buf, unsigned long sz)
static void grab_commit_values(struct atom_value *val, int deref, struct object *obj, void *buf, unsigned long sz)
{
{
@ -315,12 +303,12 @@ static void grab_commit_values(struct atom_value *val, int deref, struct object
}
}
if (!strcmp(name, "numparent")) {
if (!strcmp(name, "numparent")) {
char *s = xmalloc(40);
char *s = xmalloc(40);
v->ul = num_parents(commit);
v->ul = commit_list_count(commit->parents);
sprintf(s, "%lu", v->ul);
sprintf(s, "%lu", v->ul);
v->s = s;
v->s = s;
}
}
else if (!strcmp(name, "parent")) {
else if (!strcmp(name, "parent")) {
int num = num_parents(commit);
int num = commit_list_count(commit->parents);
int i;
int i;
struct commit_list *parents;
struct commit_list *parents;
char *s = xmalloc(41 * num + 1);
char *s = xmalloc(41 * num + 1);