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

Method add_file

pygit2/config.py:252–258  ·  view source on GitHub ↗

Add a config file instance to an existing config.

(self, path: str | Path, level: int = 0, force: int = 0)

Source from the content-addressed store, hash-verified

250 return res[0]
251
252 def add_file(self, path: str | Path, level: int = 0, force: int = 0) -> None:
253 """Add a config file instance to an existing config."""
254
255 err = C.git_config_add_file_ondisk(
256 self._config, to_bytes(path), level, ffi.NULL, force
257 )
258 check_error(err)
259
260 def snapshot(self) -> 'Config':
261 """Create a snapshot from this Config object.

Callers 5

test_addFunction · 0.95
test_add_aspathFunction · 0.95
test_multivarFunction · 0.95
test_valueless_key_valueFunction · 0.95

Calls 2

to_bytesFunction · 0.85
check_errorFunction · 0.85

Tested by 5

test_addFunction · 0.76
test_add_aspathFunction · 0.76
test_multivarFunction · 0.76
test_valueless_key_valueFunction · 0.76