summaryrefslogtreecommitdiff
path: root/builtin/name-rev.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/name-rev.c')
-rw-r--r--builtin/name-rev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 0377fc1..cac66a5 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -162,7 +162,7 @@ static int name_ref(const char *path, const struct object_id *oid, int flags, vo
struct tag *t = (struct tag *) o;
if (!t->tagged)
break; /* broken repository */
- o = parse_object(t->tagged->sha1);
+ o = parse_object(get_object_hash(*t->tagged));
deref = 1;
}
if (o && o->type == OBJ_COMMIT) {
@@ -193,7 +193,7 @@ static const char *get_exact_ref_match(const struct object *o)
tip_table.sorted = 1;
}
- found = sha1_pos(o->sha1, tip_table.table, tip_table.nr,
+ found = sha1_pos(get_object_hash(*o), tip_table.table, tip_table.nr,
nth_tip_table_ent);
if (0 <= found)
return tip_table.table[found].refname;
@@ -232,7 +232,7 @@ static void show_name(const struct object *obj,
int always, int allow_undefined, int name_only)
{
const char *name;
- const unsigned char *sha1 = obj->sha1;
+ const unsigned char *sha1 = get_object_hash(*obj);
if (!name_only)
printf("%s ", caller_name ? caller_name : sha1_to_hex(sha1));