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

Method __getitem__

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

Source from the content-addressed store, hash-verified

498 self._index = index
499
500 def __getitem__(self, path):
501 cancestor = ffi.new('git_index_entry **')
502 cours = ffi.new('git_index_entry **')
503 ctheirs = ffi.new('git_index_entry **')
504
505 err = C.git_index_conflict_get(
506 cancestor, cours, ctheirs, self._index._index, to_bytes(path)
507 )
508 check_error(err)
509
510 ancestor = IndexEntry._from_c(cancestor[0])
511 ours = IndexEntry._from_c(cours[0])
512 theirs = IndexEntry._from_c(ctheirs[0])
513
514 return ancestor, ours, theirs
515
516 def __delitem__(self, path):
517 err = C.git_index_conflict_remove(self._index._index, to_bytes(path))

Callers

nothing calls this directly

Calls 3

to_bytesFunction · 0.85
check_errorFunction · 0.85
_from_cMethod · 0.45

Tested by

no test coverage detected