aboutsummaryrefslogtreecommitdiffstats
path: root/pack-bitmap-write.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-02-10 14:48:31 -0800
committerJunio C Hamano <gitster@pobox.com>2021-02-10 14:48:31 -0800
commit9d5b1c06ac1e46e985b5d62bccb78d9fb6de374a (patch)
treec608df8a6a629c97921530898a40b7ffa52b1a35 /pack-bitmap-write.c
parent1d4f2316c5b767ccbf20cc3d55c98d1f92e6e1ce (diff)
parent8380dcd700e80cd22745bcffb3625f90f943950c (diff)
downloadgit-9d5b1c06ac1e46e985b5d62bccb78d9fb6de374a.tar.gz
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 'pack-bitmap-write.c')
-rw-r--r--pack-bitmap-write.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index 92460a6126..88d9e696a5 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -610,10 +610,10 @@ static inline void dump_bitmap(struct hashfile *f, struct ewah_bitmap *bitmap)
die("Failed to write bitmap index");
}
-static const unsigned char *sha1_access(size_t pos, void *table)
+static const struct object_id *oid_access(size_t pos, const void *table)
{
- struct pack_idx_entry **index = table;
- return index[pos]->oid.hash;
+ const struct pack_idx_entry * const *index = table;
+ return &index[pos]->oid;
}
static void write_selected_commits_v1(struct hashfile *f,
@@ -626,7 +626,7 @@ static void write_selected_commits_v1(struct hashfile *f,
struct bitmapped_commit *stored = &writer.selected[i];
int commit_pos =
- hash_pos(stored->commit->object.oid.hash, index, index_nr, sha1_access);
+ oid_pos(&stored->commit->object.oid, index, index_nr, oid_access);
if (commit_pos < 0)
BUG("trying to write commit not in index");