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

Method __getitem__

pygit2/repository.py:275–279  ·  view source on GitHub ↗
(self, key: str | Oid)

Source from the content-addressed store, hash-verified

273 return value if (value is not None) else default
274
275 def __getitem__(self, key: str | Oid) -> Object:
276 value = self.git_object_lookup_prefix(key)
277 if value is None:
278 raise KeyError(key)
279 return value
280
281 def __contains__(self, key: str | Oid) -> bool:
282 return self.git_object_lookup_prefix(key) is not None

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected