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

Function Repository_lookup_branch

src/repository.c:333–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 "in the branch name (eg 'origin/master').");
332
333PyObject *
334Repository_lookup_branch(Repository *self, PyObject *args)
335{
336 git_reference *c_reference;
337 const char *c_name;
338 Py_ssize_t c_name_len;
339 git_branch_t branch_type = GIT_BRANCH_LOCAL;
340 int err;
341
342 if (!PyArg_ParseTuple(args, "s#|I", &c_name, &c_name_len, &branch_type))
343 return NULL;
344
345 err = git_branch_lookup(&c_reference, self->repo, c_name, branch_type);
346 if (err == 0)
347 return wrap_branch(c_reference, self);
348
349 if (err == GIT_ENOTFOUND)
350 Py_RETURN_NONE;
351
352 return Error_set(err);
353}
354
355
356PyDoc_STRVAR(Repository_path_is_ignored__doc__,

Callers

nothing calls this directly

Calls 2

wrap_branchFunction · 0.85
Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…