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

Method __contains__

pygit2/index.py:81–87  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

79 return C.git_index_entrycount(self._index)
80
81 def __contains__(self, path) -> bool:
82 err = C.git_index_find(ffi.NULL, self._index, to_bytes(path))
83 if err == C.GIT_ENOTFOUND:
84 return False
85
86 check_error(err)
87 return True
88
89 def __getitem__(self, key: str | int | PathLike[str]) -> 'IndexEntry':
90 centry = ffi.NULL

Callers

nothing calls this directly

Calls 2

to_bytesFunction · 0.85
check_errorFunction · 0.85

Tested by

no test coverage detected