| 130 | } |
| 131 | |
| 132 | static int |
| 133 | pygit2_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 | |
| 156 | static int |
| 157 | pygit2_refdb_backend_exists(int *exists, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…