Merge branch 'bc/object-id'
Conversion from uchar[20] to struct object_id continues. * bc/object-id: (36 commits) convert: convert to struct object_id sha1_file: introduce a constant for max header length Convert lookup_replace_object to struct object_id sha1_file: convert read_sha1_file to struct object_id sha1_file: convert read_object_with_reference to object_id tree-walk: convert tree entry functions to object_id streaming: convert istream internals to struct object_id tree-walk: convert get_tree_entry_follow_symlinks internals to object_id builtin/notes: convert static functions to object_id builtin/fmt-merge-msg: convert remaining code to object_id sha1_file: convert sha1_object_info* to object_id Convert remaining callers of sha1_object_info_extended to object_id packfile: convert unpack_entry to struct object_id sha1_file: convert retry_bad_packed_offset to struct object_id sha1_file: convert assert_sha1_type to object_id builtin/mktree: convert to struct object_id streaming: convert open_istream to use struct object_id sha1_file: convert check_sha1_signature to struct object_id sha1_file: convert read_loose_object to use struct object_id builtin/index-pack: convert struct ref_delta_entry to object_id ...
This commit is contained in:
@ -53,8 +53,8 @@ static int show_reference(const char *refname, const struct object_id *oid,
|
||||
if (get_oid(refname, &object))
|
||||
return error("Failed to resolve '%s' as a valid ref.", refname);
|
||||
|
||||
obj_type = sha1_object_info(object.hash, NULL);
|
||||
repl_type = sha1_object_info(oid->hash, NULL);
|
||||
obj_type = oid_object_info(&object, NULL);
|
||||
repl_type = oid_object_info(oid, NULL);
|
||||
|
||||
printf("%s (%s) -> %s (%s)\n", refname, type_name(obj_type),
|
||||
oid_to_hex(oid), type_name(repl_type));
|
||||
@ -162,8 +162,8 @@ static int replace_object_oid(const char *object_ref,
|
||||
struct ref_transaction *transaction;
|
||||
struct strbuf err = STRBUF_INIT;
|
||||
|
||||
obj_type = sha1_object_info(object->hash, NULL);
|
||||
repl_type = sha1_object_info(repl->hash, NULL);
|
||||
obj_type = oid_object_info(object, NULL);
|
||||
repl_type = oid_object_info(repl, NULL);
|
||||
if (!force && obj_type != repl_type)
|
||||
die("Objects must be of the same type.\n"
|
||||
"'%s' points to a replaced object of type '%s'\n"
|
||||
@ -290,7 +290,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)
|
||||
if (get_oid(object_ref, &old_oid) < 0)
|
||||
die("Not a valid object name: '%s'", object_ref);
|
||||
|
||||
type = sha1_object_info(old_oid.hash, NULL);
|
||||
type = oid_object_info(&old_oid, NULL);
|
||||
if (type < 0)
|
||||
die("unable to get object type for %s", oid_to_hex(&old_oid));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user