Merge branch 'jk/oidhash'
Code clean-up to remove hardcoded SHA-1 hash from many places. * jk/oidhash: hashmap: convert sha1hash() to oidhash() hash.h: move object_id definition from cache.h khash: rename oid helper functions khash: drop sha1-specific map types pack-bitmap: convert khash_sha1 maps into kh_oid_map delta-islands: convert island_marks khash to use oids khash: rename kh_oid_t to kh_oid_set khash: drop broken oid_map typedef object: convert create_object() to use object_id object: convert internal hash_obj() to object_id object: convert lookup_object() to use object_id object: convert lookup_unknown_object() to use object_id pack-objects: convert locate_object_entry_hash() to object_id pack-objects: convert packlist_find() to use object_id pack-bitmap-write: convert some helpers to use object_id upload-pack: rename a "sha1" variable to "oid" describe: fix accidental oid/hash type-punning
This commit is contained in:
5
commit.c
5
commit.c
@ -57,10 +57,9 @@ struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref
|
||||
|
||||
struct commit *lookup_commit(struct repository *r, const struct object_id *oid)
|
||||
{
|
||||
struct object *obj = lookup_object(r, oid->hash);
|
||||
struct object *obj = lookup_object(r, oid);
|
||||
if (!obj)
|
||||
return create_object(r, oid->hash,
|
||||
alloc_commit_node(r));
|
||||
return create_object(r, oid, alloc_commit_node(r));
|
||||
return object_as_type(r, obj, OBJ_COMMIT, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user