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

Function pygit2_refdb_backend_lookup

src/refdb_backend.c:179–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179static int
180pygit2_refdb_backend_lookup(git_reference **out,
181 git_refdb_backend *_be, const char *ref_name)
182{
183 int err;
184 PyObject *args;
185 Reference *result;
186 struct pygit2_refdb_backend *be = (struct pygit2_refdb_backend *)_be;
187
188 if ((args = Py_BuildValue("(s)", ref_name)) == NULL)
189 return GIT_EUSER;
190 result = (Reference *)PyObject_CallObject(be->lookup, args);
191 Py_DECREF(args);
192
193 if ((err = git_error_for_exc()) != 0)
194 goto out;
195
196 if (!PyObject_IsInstance((PyObject *)result, (PyObject *)&ReferenceType)) {
197 PyErr_SetString(PyExc_TypeError, "Expected object of type pygit2.Reference");
198 err = GIT_EUSER;
199 goto out;
200 }
201
202 *out = result->reference;
203out:
204 return err;
205}
206
207static int
208pygit2_refdb_backend_write(git_refdb_backend *_be,

Callers

nothing calls this directly

Calls 1

git_error_for_excFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…