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

Function cache_ref_iterator_begin

refs/ref-cache.c:563–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561};
562
563struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache,
564 const char *prefix,
565 struct repository *repo,
566 int prime_dir)
567{
568 struct cache_ref_iterator *iter;
569 struct ref_iterator *ref_iterator;
570
571 CALLOC_ARRAY(iter, 1);
572 ref_iterator = &iter->base;
573 base_ref_iterator_init(ref_iterator, &cache_ref_iterator_vtable);
574 ALLOC_GROW(iter->levels, 10, iter->levels_alloc);
575
576 iter->repo = repo;
577 iter->cache = cache;
578 iter->prime_dir = prime_dir;
579
580 if (cache_ref_iterator_seek(&iter->base, prefix,
581 REF_ITERATOR_SEEK_SET_PREFIX) < 0) {
582 ref_iterator_free(&iter->base);
583 return NULL;
584 }
585
586 return ref_iterator;
587}

Callers 3

files_ref_iterator_beginFunction · 0.85
should_pack_refsFunction · 0.85
files_optimizeFunction · 0.85

Calls 3

base_ref_iterator_initFunction · 0.85
cache_ref_iterator_seekFunction · 0.85
ref_iterator_freeFunction · 0.85

Tested by

no test coverage detected