MCPcopy Create free account
hub / github.com/git/git / for_each_preferred_bitmap_tip

Function for_each_preferred_bitmap_tip

pack-bitmap.c:3325–3351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3323}
3324
3325void 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
3353int bitmap_is_preferred_refname(struct repository *r, const char *refname)
3354{

Callers 2

midx_snapshot_refsFunction · 0.85
get_object_listFunction · 0.85

Calls 6

bitmap_preferred_tipsFunction · 0.85
ends_withFunction · 0.85
strbuf_addfFunction · 0.85
refs_for_each_ref_extFunction · 0.85
get_main_ref_storeFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected