MCPcopy Index your code
hub / github.com/git/git / prefix_ref_iterator_begin

Function prefix_ref_iterator_begin

refs/iterator.c:403–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401};
402
403struct ref_iterator *prefix_ref_iterator_begin(struct ref_iterator *iter0,
404 const char *prefix,
405 int trim)
406{
407 struct prefix_ref_iterator *iter;
408 struct ref_iterator *ref_iterator;
409
410 if (!*prefix && !trim)
411 return iter0; /* optimization: no need to wrap iterator */
412
413 CALLOC_ARRAY(iter, 1);
414 ref_iterator = &iter->base;
415
416 base_ref_iterator_init(ref_iterator, &prefix_ref_iterator_vtable);
417
418 iter->iter0 = iter0;
419 iter->prefix = xstrdup(prefix);
420 iter->trim = trim;
421
422 return ref_iterator;
423}
424
425int do_for_each_ref_iterator(struct ref_iterator *iter,
426 refs_for_each_cb fn, void *cb_data)

Callers 1

refs_ref_iterator_beginFunction · 0.85

Calls 2

base_ref_iterator_initFunction · 0.85
xstrdupFunction · 0.85

Tested by

no test coverage detected