diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-02 13:13:43 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-07 14:43:51 -0700 |
| commit | 5420901bde8043a298b8ae5e5b3c3cfc1b67039b (patch) | |
| tree | 0f77f67d5d562723c4bc997ad69747ef857f3935 /pack-bitmap.h | |
| parent | 3d45483846368796d12f62d7d15daaa59d9d8a5c (diff) | |
| download | git-5420901bde8043a298b8ae5e5b3c3cfc1b67039b.tar.xz | |
pack-bitmap: add function to iterate over filtered bitmapped objects
Introduce a function that allows the caller to iterate over all
bitmapped objects that match a given filter. This mechanism will be used
in a subsequent commit to optimize object filters in git-cat-file(1).
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.h')
| -rw-r--r-- | pack-bitmap.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pack-bitmap.h b/pack-bitmap.h index de6bf534fe..079bae3246 100644 --- a/pack-bitmap.h +++ b/pack-bitmap.h @@ -79,6 +79,18 @@ int test_bitmap_pseudo_merges(struct repository *r); int test_bitmap_pseudo_merge_commits(struct repository *r, uint32_t n); int test_bitmap_pseudo_merge_objects(struct repository *r, uint32_t n); +struct list_objects_filter_options; + +/* + * Filter bitmapped objects and iterate through all resulting objects, + * executing `show_reach` for each of them. Returns `-1` in case the filter is + * not supported, `0` otherwise. + */ +int for_each_bitmapped_object(struct bitmap_index *bitmap_git, + struct list_objects_filter_options *filter, + show_reachable_fn show_reach, + void *payload); + #define GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL \ "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL" |
