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:

committed by
Jeff King

parent
7999b2cf77
commit
f2fd0760f6
@ -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[] = {
|
||||
|
Reference in New Issue
Block a user