projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shrink "struct object" a bit
[git.git]
/
commit.c
diff --git
a/commit.c
b/commit.c
index
94f470b
..
11fca55
100644
(file)
--- a/
commit.c
+++ b/
commit.c
@@
-56,10
+56,10
@@
static struct commit *check_commit(struct object *obj,
const unsigned char *sha1,
int quiet)
{
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",
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;
return NULL;
}
return (struct commit *) obj;
@@
-86,11
+86,11
@@
struct commit *lookup_commit(const unsigned char *sha1)
if (!obj) {
struct commit *ret = xcalloc(1, sizeof(struct commit));
created_object(sha1, &ret->object);
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)
return ret;
}
if (!obj->type)
- obj->type =
commit_type
;
+ obj->type =
TYPE_COMMIT
;
return check_commit(obj, sha1, 0);
}
return check_commit(obj, sha1, 0);
}