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

Function Branch_upstream_name__get__

src/branch.c:255–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 "The name of the reference set to be the upstream of this one");
254
255PyObject *
256Branch_upstream_name__get__(Branch *self)
257{
258 int err;
259 git_buf name = {NULL};
260 const char *branch_name;
261 PyObject *py_name;
262
263 CHECK_REFERENCE(self);
264
265 branch_name = git_reference_name(self->reference);
266
267 err = git_branch_upstream_name(&name, self->repo->repo, branch_name);
268 if (err < GIT_OK)
269 return Error_set(err);
270
271 py_name = to_unicode_n(name.ptr, name.size, NULL, NULL);
272 git_buf_dispose(&name);
273
274 return py_name;
275}
276
277
278static PyMethodDef Branch_methods[] = {

Callers

nothing calls this directly

Calls 2

Error_setFunction · 0.85
to_unicode_nFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…