Merge branch 'bc/object-id'
More transition from "unsigned char[40]" to "struct object_id". This needed a few merge fixups, but is mostly disentangled from other topics. * bc/object-id: remote: convert functions to struct object_id Remove get_object_hash. Convert struct object to object_id Add several uses of get_object_hash. object: introduce get_object_hash macro. ref_newer: convert to use struct object_id push_refs_with_export: convert to struct object_id get_remote_heads: convert to struct object_id parse_fetch: convert to use struct object_id add_sought_entry_mem: convert to struct object_id Convert struct ref to use object_id. sha1_file: introduce has_object_file helper.
This commit is contained in:
@ -459,7 +459,7 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
|
||||
struct object *obj, const char *name, const char *path)
|
||||
{
|
||||
if (obj->type == OBJ_BLOB)
|
||||
return grep_sha1(opt, obj->sha1, name, 0, path);
|
||||
return grep_sha1(opt, obj->oid.hash, name, 0, path);
|
||||
if (obj->type == OBJ_COMMIT || obj->type == OBJ_TREE) {
|
||||
struct tree_desc tree;
|
||||
void *data;
|
||||
@ -468,12 +468,12 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
|
||||
int hit, len;
|
||||
|
||||
grep_read_lock();
|
||||
data = read_object_with_reference(obj->sha1, tree_type,
|
||||
data = read_object_with_reference(obj->oid.hash, tree_type,
|
||||
&size, NULL);
|
||||
grep_read_unlock();
|
||||
|
||||
if (!data)
|
||||
die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
|
||||
die(_("unable to read tree (%s)"), oid_to_hex(&obj->oid));
|
||||
|
||||
len = name ? strlen(name) : 0;
|
||||
strbuf_init(&base, PATH_MAX + len + 1);
|
||||
|
Reference in New Issue
Block a user