Convert struct object to object_id

struct object is one of the major data structures dealing with object
IDs.  Convert it to use struct object_id instead of an unsigned char
array.  Convert get_object_hash to refer to the new member as well.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
brian m. carlson
2015-11-10 02:22:28 +00:00
committed by Jeff King
parent 7999b2cf77
commit f2fd0760f6
54 changed files with 256 additions and 256 deletions

View File

@ -232,19 +232,19 @@ static void show_name(const struct object *obj,
int always, int allow_undefined, int name_only)
{
const char *name;
const unsigned char *sha1 = get_object_hash(*obj);
const struct object_id *oid = &obj->oid;
if (!name_only)
printf("%s ", caller_name ? caller_name : sha1_to_hex(sha1));
printf("%s ", caller_name ? caller_name : oid_to_hex(oid));
name = get_rev_name(obj);
if (name)
printf("%s\n", name);
else if (allow_undefined)
printf("undefined\n");
else if (always)
printf("%s\n", find_unique_abbrev(sha1, DEFAULT_ABBREV));
printf("%s\n", find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
else
die("cannot describe '%s'", sha1_to_hex(sha1));
die("cannot describe '%s'", oid_to_hex(oid));
}
static char const * const name_rev_usage[] = {