| 536 | |
| 537 | |
| 538 | class 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…