diff options
author | Jeff King <peff@peff.net> | 2022-10-21 20:21:45 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-21 18:03:52 -0700 |
commit | d3d9c51973bf3187d8767969a0aa33abe79d6240 (patch) | |
tree | ceae4f5545786903776b3449829f139c9ab6a483 /commit.c | |
parent | d5b41391a472dcf9486055fd5b8517f893e88daf (diff) |
repack: convert "names" util bitfield to array
We keep a string_list "names" containing the hashes of packs generated
on our behalf by pack-objects. The util field of each item is treated as
a bitfield that tells us which extensions (.pack, .idx, .rev, etc) are
present for each name.
Let's switch this to allocating a real array. That will give us room in
a future patch to store more data than just a single bit per extension.
And it makes the code a little easier to read, as we avoid casting back
and forth between uintptr_t and a void pointer.
Since the only thing we're storing is an array, we could just allocate
it directly. But instead I've put it into a named struct here. That
further increases readability around the casts, and in particular helps
differentiate us from other string_lists in the same file which use
their util field differently. E.g., the existing_*_packs lists still do
bit-twiddling, but their bits have different meaning than the ones in
"names". This makes it hard to grep around the code to see how the util
fields are used; now you can look for "generated_pack_data".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions