diff options
author | Junio C Hamano <junkio@cox.net> | 2007-04-22 02:41:40 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-22 02:42:02 +0200 |
commit | 42c4b58059fa9af65e90f2c418bb551e30d1d32f (patch) | |
tree | c6aa1b75909009b249ceb768717c27011b73adb4 /commit.c | |
parent | Merge branch 'jc/add' (diff) | |
parent | Clean up object creation to use more common code (diff) | |
download | git-42c4b58059fa9af65e90f2c418bb551e30d1d32f.tar.xz git-42c4b58059fa9af65e90f2c418bb551e30d1d32f.zip |
Merge branch 'lt/objalloc'
* 'lt/objalloc':
Clean up object creation to use more common code
Use proper object allocators for unknown object nodes too
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -98,12 +98,8 @@ struct commit *lookup_commit_reference(const unsigned char *sha1) struct commit *lookup_commit(const unsigned char *sha1) { struct object *obj = lookup_object(sha1); - if (!obj) { - struct commit *ret = alloc_commit_node(); - created_object(sha1, &ret->object); - ret->object.type = OBJ_COMMIT; - return ret; - } + if (!obj) + return create_object(sha1, OBJ_COMMIT, alloc_commit_node()); if (!obj->type) obj->type = OBJ_COMMIT; return check_commit(obj, sha1, 0); |