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

Method __init__

pygit2/config.py:87–97  ·  view source on GitHub ↗
(self, path: str | None = None)

Source from the content-addressed store, hash-verified

85 _config: 'GitConfigC'
86
87 def __init__(self, path: str | None = None) -> None:
88 cconfig = ffi.new('git_config **')
89
90 if not path:
91 err = C.git_config_new(cconfig)
92 else:
93 path_bytes = str_to_bytes(path, 'path')
94 err = C.git_config_open_ondisk(cconfig, path_bytes)
95
96 check_error(err, io=True)
97 self._config = cconfig[0]
98
99 @classmethod
100 def from_c(cls, repo: 'BaseRepository', ptr: 'GitConfigC') -> 'Config':

Callers

nothing calls this directly

Calls 2

str_to_bytesFunction · 0.85
check_errorFunction · 0.85

Tested by

no test coverage detected