summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-02-10 14:48:31 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-02-10 14:48:31 -0800
commit9d5b1c06ac1e46e985b5d62bccb78d9fb6de374a (patch)
treec608df8a6a629c97921530898a40b7ffa52b1a35 /builtin
parentSync with 2.30.1 (diff)
parentoid_pos(): access table through const pointers (diff)
downloadtgif-9d5b1c06ac1e46e985b5d62bccb78d9fb6de374a.tar.xz
Merge branch 'jk/use-oid-pos'
Code clean-up to ensure our use of hashtables using object names as keys use the "struct object_id" objects, not the raw hash values. * jk/use-oid-pos: oid_pos(): access table through const pointers hash_pos(): convert to oid_pos() rerere: use strmap to store rerere directories rerere: tighten rr-cache dirname check rerere: check dirname format while iterating rr_cache directory commit_graft_pos(): take an oid instead of a bare hash
Diffstat (limited to 'builtin')
-rw-r--r--builtin/name-rev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 3fe71a8c01..b221d30014 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -390,10 +390,10 @@ static void name_tips(void)
}
}
-static const unsigned char *nth_tip_table_ent(size_t ix, void *table_)
+static const struct object_id *nth_tip_table_ent(size_t ix, const void *table_)
{
- struct tip_table_entry *table = table_;
- return table[ix].oid.hash;
+ const struct tip_table_entry *table = table_;
+ return &table[ix].oid;
}
static const char *get_exact_ref_match(const struct object *o)
@@ -408,8 +408,8 @@ static const char *get_exact_ref_match(const struct object *o)
tip_table.sorted = 1;
}
- found = hash_pos(o->oid.hash, tip_table.table, tip_table.nr,
- nth_tip_table_ent);
+ found = oid_pos(&o->oid, tip_table.table, tip_table.nr,
+ nth_tip_table_ent);
if (0 <= found)
return tip_table.table[found].refname;
return NULL;