diff options
author | Jeff King <peff@peff.net> | 2020-02-12 21:16:15 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-13 09:08:58 -0800 |
commit | 551cf8b655fa73c90dabea633d41b5f10deffaf2 (patch) | |
tree | 383f605a4a3c209ce9935ad38d99f8422207047c /line-log.h | |
parent | Git 2.25 (diff) | |
download | tgif-551cf8b655fa73c90dabea633d41b5f10deffaf2.tar.xz |
pack-bitmap: factor out type iterator initialization
When count_object_type() wants to iterate over the bitmap of all objects
of a certain type, we have to pair up OBJ_COMMIT with bitmap->commits,
and so forth. Since we're about to add more code to iterate over these
bitmaps, let's pull the initialization into its own function.
We can also use this to simplify traverse_bitmap_commit_list(). It
accomplishes the same thing by manually passing the object type and the
bitmap to show_objects_for_type(), but using our helper we just need the
object type.
Note there's one small code change here: previously we'd simply return
zero when counting an unknown object type, and now we'll BUG(). This
shouldn't matter in practice, as all of the callers pass in only usual
commit/tree/blob/tag types.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'line-log.h')
0 files changed, 0 insertions, 0 deletions