diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-02-23 12:59:45 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-23 13:21:18 -0800 |
| commit | 00be226f1f2a1036ea3920f8700b23b7cc55bf57 (patch) | |
| tree | 34cf7daa6ad015c32e8400fbf99747461cc3c151 /pack-bitmap.c | |
| parent | 5507200b504f478516bf93767ac3ed3bebed7226 (diff) | |
| download | git-00be226f1f2a1036ea3920f8700b23b7cc55bf57.tar.xz | |
refs: replace `refs_for_each_ref_in()`
Replace calls to `refs_for_each_ref_in()` with the newly introduced
`refs_for_each_ref_ext()` function.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
| -rw-r--r-- | pack-bitmap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index efef7081e6..22419bfb33 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -3326,6 +3326,7 @@ static const struct string_list *bitmap_preferred_tips(struct repository *r) void for_each_preferred_bitmap_tip(struct repository *repo, refs_for_each_cb cb, void *cb_data) { + struct refs_for_each_ref_options opts = { 0 }; struct string_list_item *item; const struct string_list *preferred_tips; struct strbuf buf = STRBUF_INIT; @@ -3335,16 +3336,16 @@ void for_each_preferred_bitmap_tip(struct repository *repo, return; for_each_string_list_item(item, preferred_tips) { - const char *pattern = item->string; + opts.prefix = item->string; - if (!ends_with(pattern, "/")) { + if (!ends_with(opts.prefix, "/")) { strbuf_reset(&buf); - strbuf_addf(&buf, "%s/", pattern); - pattern = buf.buf; + strbuf_addf(&buf, "%s/", opts.prefix); + opts.prefix = buf.buf; } - refs_for_each_ref_in(get_main_ref_store(repo), - pattern, cb, cb_data); + refs_for_each_ref_ext(get_main_ref_store(repo), + cb, cb_data, &opts); } strbuf_release(&buf); |
