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

Class ConflictIterator

pygit2/index.py:538–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536
537
538class ConflictIterator:
539 def __init__(self, index):
540 citer = ffi.new('git_index_conflict_iterator **')
541 err = C.git_index_conflict_iterator_new(citer, index._index)
542 check_error(err)
543 self._index = index
544 self._iter = citer[0]
545
546 def __del__(self):
547 C.git_index_conflict_iterator_free(self._iter)
548
549 def __iter__(self):
550 return self
551
552 def __next__(self):
553 cancestor = ffi.new('git_index_entry **')
554 cours = ffi.new('git_index_entry **')
555 ctheirs = ffi.new('git_index_entry **')
556
557 err = C.git_index_conflict_next(cancestor, cours, ctheirs, self._iter)
558 if err == C.GIT_ITEROVER:
559 raise StopIteration
560
561 check_error(err)
562
563 ancestor = IndexEntry._from_c(cancestor[0])
564 ours = IndexEntry._from_c(cours[0])
565 theirs = IndexEntry._from_c(ctheirs[0])
566
567 return ancestor, ours, theirs

Callers 1

__iter__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…