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

Function packed_ref_iterator_seek

refs/packed-backend.c:1014–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014static int packed_ref_iterator_seek(struct ref_iterator *ref_iterator,
1015 const char *refname, unsigned int flags)
1016{
1017 struct packed_ref_iterator *iter =
1018 (struct packed_ref_iterator *)ref_iterator;
1019 const char *start;
1020
1021 if (refname && *refname)
1022 start = find_reference_location(iter->snapshot, refname, 0);
1023 else
1024 start = iter->snapshot->start;
1025
1026 /* Unset any previously set prefix */
1027 FREE_AND_NULL(iter->prefix);
1028
1029 if (flags & REF_ITERATOR_SEEK_SET_PREFIX)
1030 iter->prefix = xstrdup_or_null(refname);
1031
1032 iter->pos = start;
1033 iter->eof = iter->snapshot->eof;
1034
1035 return 0;
1036}
1037
1038static void packed_ref_iterator_release(struct ref_iterator *ref_iterator)
1039{

Callers 1

Calls 2

find_reference_locationFunction · 0.85
xstrdup_or_nullFunction · 0.85

Tested by

no test coverage detected