| 3323 | } |
| 3324 | |
| 3325 | void for_each_preferred_bitmap_tip(struct repository *repo, |
| 3326 | refs_for_each_cb cb, void *cb_data) |
| 3327 | { |
| 3328 | struct refs_for_each_ref_options opts = { 0 }; |
| 3329 | struct string_list_item *item; |
| 3330 | const struct string_list *preferred_tips; |
| 3331 | struct strbuf buf = STRBUF_INIT; |
| 3332 | |
| 3333 | preferred_tips = bitmap_preferred_tips(repo); |
| 3334 | if (!preferred_tips) |
| 3335 | return; |
| 3336 | |
| 3337 | for_each_string_list_item(item, preferred_tips) { |
| 3338 | opts.prefix = item->string; |
| 3339 | |
| 3340 | if (!ends_with(opts.prefix, "/")) { |
| 3341 | strbuf_reset(&buf); |
| 3342 | strbuf_addf(&buf, "%s/", opts.prefix); |
| 3343 | opts.prefix = buf.buf; |
| 3344 | } |
| 3345 | |
| 3346 | refs_for_each_ref_ext(get_main_ref_store(repo), |
| 3347 | cb, cb_data, &opts); |
| 3348 | } |
| 3349 | |
| 3350 | strbuf_release(&buf); |
| 3351 | } |
| 3352 | |
| 3353 | int bitmap_is_preferred_refname(struct repository *r, const char *refname) |
| 3354 | { |
no test coverage detected