const unsigned char *sha1,
int quiet)
{
- if (obj->type != commit_type) {
+ if (obj->type != TYPE_COMMIT) {
if (!quiet)
error("Object %s is a %s, not a commit",
- sha1_to_hex(sha1), obj->type);
+ sha1_to_hex(sha1), typename(obj->type));
return NULL;
}
return (struct commit *) obj;
if (!obj) {
struct commit *ret = xcalloc(1, sizeof(struct commit));
created_object(sha1, &ret->object);
- ret->object.type = commit_type;
+ ret->object.type = TYPE_COMMIT;
return ret;
}
if (!obj->type)
- obj->type = commit_type;
+ obj->type = TYPE_COMMIT;
return check_commit(obj, sha1, 0);
}
void topo_sort_default_setter(struct commit *c, void *data)
{
- c->object.util = data;
+ c->util = data;
}
void *topo_sort_default_getter(struct commit *c)
{
- return c->object.util;
+ return c->util;
}
/*