MCPcopy Create free account
hub / github.com/libgit2/pygit2 / pygit2_refdb_backend_iterator

Function pygit2_refdb_backend_iterator

src/refdb_backend.c:132–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132static int
133pygit2_refdb_backend_iterator(git_reference_iterator **iter,
134 struct git_refdb_backend *_be,
135 const char *glob)
136{
137 struct pygit2_refdb_backend *be = (struct pygit2_refdb_backend *)_be;
138 PyObject *iterator = PyObject_GetIter((PyObject *)be->RefdbBackend);
139 assert(iterator);
140
141 struct pygit2_refdb_iterator *pyiter = calloc(1, sizeof(struct pygit2_refdb_iterator));
142 if (pyiter == NULL) {
143 Py_DECREF(iterator);
144 git_error_set(GIT_ERROR_NOMEMORY, "out of memory");
145 return GIT_ERROR;
146 }
147 *iter = (git_reference_iterator *)pyiter;
148 pyiter->iterator = iterator;
149 pyiter->base.next = pygit2_refdb_iterator_next;
150 pyiter->base.next_name = pygit2_refdb_iterator_next_name;
151 pyiter->base.free = pygit2_refdb_iterator_free;
152 pyiter->glob = strdup(glob);
153 return 0;
154}
155
156static int
157pygit2_refdb_backend_exists(int *exists,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…