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

Function Tree_subscript

src/tree.c:185–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185PyObject*
186Tree_subscript(Tree *self, PyObject *value)
187{
188 if (Object__load((Object*)self) == NULL) { return NULL; } // Lazy load
189
190 /* Case 1: integer */
191 if (PyLong_Check(value))
192 return tree_getentry_by_index(self->tree, self->repo, value);
193
194 /* Case 2: byte or text string */
195 return tree_getentry_by_path(self->tree, self->repo, value);
196}
197
198PyObject *
199Tree_divide(Tree *self, PyObject *value)

Callers

nothing calls this directly

Calls 3

Object__loadFunction · 0.85
tree_getentry_by_indexFunction · 0.85
tree_getentry_by_pathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…