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

Function Refdb_new

src/refdb.c:82–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 "Creates a new refdb with no backend.");
81
82PyObject *
83Refdb_new(PyObject *self, Repository *repo)
84{
85 if (!PyObject_IsInstance((PyObject *)repo, (PyObject *)&RepositoryType)) {
86 PyErr_SetString(PyExc_TypeError,
87 "Refdb.new expects an object of type "
88 "pygit2.Repository");
89 return NULL;
90 }
91
92 git_refdb *refdb;
93 int err = git_refdb_new(&refdb, repo->repo);
94 if (err) {
95 Error_set(err);
96 return NULL;
97 }
98
99 return wrap_refdb(refdb);
100}
101
102PyDoc_STRVAR(Refdb_open__doc__,
103 "open(repo: Repository) -> Refdb\n"

Callers

nothing calls this directly

Calls 2

Error_setFunction · 0.85
wrap_refdbFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…